1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-20 17:58:24 +03:00

Fix string writting in local config file

This commit is contained in:
Alexey Kachayev 2010-03-30 12:57:19 +00:00
parent f01bd2b296
commit 5ca9c8a44a

View file

@ -356,9 +356,9 @@ class Install {
* то меняем значение.
*/
if(substr_count($sConfig, $sName)) {
$sConfig=preg_replace("~".preg_quote($sName).".+;~Ui", $sName.' = '.$sVar.';', $sConfig);
$sConfig=preg_replace("~".preg_quote($sName).".+;~Ui", $sName.' = '.addslashes($sVar).';', $sConfig);
} else {
$sConfig=str_replace('return $config;', $sName.' = '.$sVar.';'.PHP_EOL.'return $config;', $sConfig);
$sConfig=str_replace('return $config;', $sName.' = '.addslashes($sVar).';'.PHP_EOL.'return $config;', $sConfig);
}
file_put_contents($sPath,$sConfig);
return true;