1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-06 14:57:10 +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) {
$values[$key] = (int) $value;
} else if($key != 'httpHosts') {
$values[$key] = htmlspecialchars($value, ENT_QUOTES, 'utf-8');
$values[$key] = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
}
@@ -1139,20 +1139,20 @@ class Installer {
if(self::TEST_MODE) return;
$restoreOptions = array();
$replace = array();
if($options['dbEngine'] != 'MyISAM') {
$replace['ENGINE=MyISAM'] = "ENGINE=$options[dbEngine]";
}
if($options['dbCharset'] != 'utf8') {
$replace['CHARSET=utf8'] = "CHARSET=$options[dbCharset]";
if(strtolower($options['dbCharset']) === 'utf8mb4') {
if(strtolower($options['dbEngine']) === 'innodb') {
$replace['(255)'] = '(191)';
$replace['(250)'] = '(191)';
} else {
$replace['(255)'] = '(250)'; // max ley length in utf8mb4 is 1000 (250 * 4)
}
$replace['ENGINE=InnoDB'] = "ENGINE=$options[dbEngine]";
$replace['ENGINE=MyISAM'] = "ENGINE=$options[dbEngine]";
$replace['CHARSET=utf8mb4;'] = "CHARSET=$options[dbCharset];";
$replace['CHARSET=utf8;'] = "CHARSET=$options[dbCharset];";
if(strtolower($options['dbCharset']) === 'utf8mb4') {
if(strtolower($options['dbEngine']) === 'innodb') {
$replace['(255)'] = '(191)';
$replace['(250)'] = '(191)';
} else {
$replace['(255)'] = '(250)'; // max ley length in utf8mb4 is 1000 (250 * 4)
}
}
if(count($replace)) $restoreOptions['findReplaceCreateTable'] = $replace;
require("./wire/core/WireDatabaseBackup.php");
$backup = new WireDatabaseBackup();