N°941 - Backup/Windows %, ! or " not allowed in password

This commit is contained in:
Eric
2019-02-15 17:03:07 +01:00
parent 17fe9dfd5f
commit 297a45d477
2 changed files with 4 additions and 4 deletions

View File

@@ -84,10 +84,10 @@ function CheckDBPasswordInNewConfig($sSafeContent)
{
$bIsWindows = (array_key_exists('WINDIR', $_SERVER) || array_key_exists('windir', $_SERVER));
if ($bIsWindows && (preg_match("@'db_pwd' => '[^%']+',@", $sSafeContent) === 0))
if ($bIsWindows && (preg_match("@'db_pwd' => '[^%!\"']+',@", $sSafeContent) === 0))
{
// Unsupported Password
throw new Exception("Database password should not contain % character (backups won't work)...");
throw new Exception("On Windows, database password must not contain %, ! or \" character (backups won't work)...");
}
}

View File

@@ -1307,11 +1307,11 @@ EOF
$sDBName = $aParameters['db_name'];
$bIsWindows = (array_key_exists('WINDIR', $_SERVER) || array_key_exists('windir', $_SERVER));
if ($bIsWindows && (strpos($sDBPwd, '%') !== false))
if ($bIsWindows && (preg_match('@([%!"])@',$sDBPwd) > 0))
{
// Unsuported Password, disable the "Next" button
$oPage->add_ready_script('$("#wiz_form").data("db_connection", "error");');
$oPage->add_ready_script('$("#db_info").html("<img src=\'../images/error.png\'/>&nbsp;Database password cannot contain % character...");');
$oPage->add_ready_script('$("#db_info").html("<img src=\'../images/error.png\'/>&nbsp;On Windows, database password must not contain %, ! or &quot; character");');
}
else
{