Merge pull request #797 from smokeypell/master

Fix for #791
This commit is contained in:
Matt Pass
2020-02-01 13:43:48 +00:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -152,7 +152,7 @@ define('SALT_LENGTH',12);
// Generate hash
function generateHash($pw) {
// Generate Bcrypt hash
return str_replace("\$", "\\$", password_hash($pw, PASSWORD_BCRYPT, $options = ['cost' => 10]));
return password_hash($pw, PASSWORD_BCRYPT, $options = ['cost' => 10]);
}
// Verify hash

View File

@@ -56,7 +56,12 @@ if (!$demoMode && isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] && isset
$settingsNew .= '"'.$settingsArray[$i].'" => ';
// Wrap certain values in double quotes
$settingWrap = $settingsArray[$i]=="root"||$settingsArray[$i]=="password"||$settingsArray[$i]=="languageUser"||$settingsArray[$i]=="theme"||$settingsArray[$i]=="fontSize"||$settingsArray[$i]=="tagWrapperCommand"||$settingsArray[$i]=="autoComplete"||$settingsArray[$i]=="pluginPanelAligned"||$settingsArray[$i]=="githubAuthToken" ? '"' : '';
$settingsNew .= $settingWrap.$ICEcoder[$settingsArray[$i]].$settingWrap.','.PHP_EOL;
if ($settingsArray[$i]=="password") {
$settingsNew .= str_replace("\$", "\\$", $settingWrap.$ICEcoder[$settingsArray[$i]].$settingWrap.','.PHP_EOL);
} else {
$settingsNew .= $settingWrap.$ICEcoder[$settingsArray[$i]].$settingWrap.','.PHP_EOL;
}
}
// Compile our new settings