diff options
| author | czaks <marcin@6irc.net> | 2013-08-04 21:17:38 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-08-04 21:17:38 -0400 |
| commit | f494b34562e555edb4c7ba14ce8444a001f36d00 (patch) | |
| tree | 5503897969e7f82f95c3607f78e3cbc3f9c8f79f /install.php | |
| parent | 7407593ec5b3b3857719a72e7bf98e0fcae4e929 (diff) | |
| parent | 0c829aa8f6fb592c15086e8b2b0276fd862e89f1 (diff) | |
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts:
inc/image.php
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 4b3785e0..56055c2e 100644 --- a/install.php +++ b/install.php @@ -626,8 +626,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 @@ -639,6 +638,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>'; |
