diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-04 15:23:26 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-04 15:23:26 -0400 |
| commit | b7070aeac68c18e96c29babbb8d60c8e8ff1c659 (patch) | |
| tree | 73c50e59e6afc5aa42e8ef2d5ebaca91ee32196b /install.php | |
| parent | 33a07e9ee0103f51991020721eb4e059e0990942 (diff) | |
Fix issue with installing and creating boards with MySQL < 5.5.3. Issue #129
Diffstat (limited to 'install.php')
| -rw-r--r-- | install.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/install.php b/install.php index 81b2e136..6971437a 100644 --- a/install.php +++ b/install.php @@ -618,8 +618,7 @@ if ($step == 0) { $sql = @file_get_contents('install.sql') or error("Couldn't load install.sql."); sql_open(); - if (mysql_version() < 50503) - $sql = preg_replace('/(CHARSET=|CHARACTER SET )utf8mb4/', '$1utf8', $sql); + $mysql_version = mysql_version(); // This code is probably horrible, but what I'm trying // to do is find all of the SQL queires and put them @@ -631,6 +630,8 @@ if ($step == 0) { $sql_errors = ''; foreach ($queries as $query) { + if ($mysql_version < 50503) + $query = preg_replace('/(CHARSET=|CHARACTER SET )utf8mb4/', '$1utf8', $query); $query = preg_replace('/^([\w\s]*)`([0-9a-zA-Z$_\x{0080}-\x{FFFF}]+)`/u', '$1``$2``', $query); if (!query($query)) $sql_errors .= '<li>' . db_error() . '</li>'; |
