summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-08-04 15:23:26 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-08-04 15:23:26 -0400
commitb7070aeac68c18e96c29babbb8d60c8e8ff1c659 (patch)
tree73c50e59e6afc5aa42e8ef2d5ebaca91ee32196b /inc
parent33a07e9ee0103f51991020721eb4e059e0990942 (diff)
Fix issue with installing and creating boards with MySQL < 5.5.3. Issue #129
Diffstat (limited to 'inc')
-rw-r--r--inc/mod/pages.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index 0a9f825b..706d747d 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -480,7 +480,12 @@ function mod_new_board() {
if (!openBoard($_POST['uri']))
error(_("Couldn't open board after creation."));
- query(Element('posts.sql', array('board' => $board['uri']))) or error(db_error());
+ $query = Element('posts.sql', array('board' => $board['uri']));
+
+ if (mysql_version() < 50503)
+ $query = preg_replace('/(CHARSET=|CHARACTER SET )utf8mb4/', '$1utf8', $query);
+
+ query($query) or error(db_error());
if ($config['cache']['enabled'])
cache::delete('all_boards');