1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 07:47:00 +02:00
This commit is contained in:
Ryan Cramer
2025-01-05 11:40:49 -05:00
parent 807e94e22a
commit f1819b5cd8

View File

@@ -492,7 +492,7 @@ class Installer {
if(strpos($key, 'chmod') === 0) { if(strpos($key, 'chmod') === 0) {
$values[$key] = (int) $value; $values[$key] = (int) $value;
} else if($key != 'httpHosts') { } else if($key != 'httpHosts') {
$values[$key] = htmlspecialchars($value, ENT_QUOTES, 'utf-8'); $values[$key] = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
} }
} }
@@ -1139,11 +1139,11 @@ class Installer {
if(self::TEST_MODE) return; if(self::TEST_MODE) return;
$restoreOptions = array(); $restoreOptions = array();
$replace = array(); $replace = array();
if($options['dbEngine'] != 'MyISAM') { $replace['ENGINE=InnoDB'] = "ENGINE=$options[dbEngine]";
$replace['ENGINE=MyISAM'] = "ENGINE=$options[dbEngine]"; $replace['ENGINE=MyISAM'] = "ENGINE=$options[dbEngine]";
} $replace['CHARSET=utf8mb4;'] = "CHARSET=$options[dbCharset];";
if($options['dbCharset'] != 'utf8') { $replace['CHARSET=utf8;'] = "CHARSET=$options[dbCharset];";
$replace['CHARSET=utf8'] = "CHARSET=$options[dbCharset]";
if(strtolower($options['dbCharset']) === 'utf8mb4') { if(strtolower($options['dbCharset']) === 'utf8mb4') {
if(strtolower($options['dbEngine']) === 'innodb') { if(strtolower($options['dbEngine']) === 'innodb') {
$replace['(255)'] = '(191)'; $replace['(255)'] = '(191)';
@@ -1152,7 +1152,7 @@ class Installer {
$replace['(255)'] = '(250)'; // max ley length in utf8mb4 is 1000 (250 * 4) $replace['(255)'] = '(250)'; // max ley length in utf8mb4 is 1000 (250 * 4)
} }
} }
}
if(count($replace)) $restoreOptions['findReplaceCreateTable'] = $replace; if(count($replace)) $restoreOptions['findReplaceCreateTable'] = $replace;
require("./wire/core/WireDatabaseBackup.php"); require("./wire/core/WireDatabaseBackup.php");
$backup = new WireDatabaseBackup(); $backup = new WireDatabaseBackup();