1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-17 07:10:48 +03:00

fix save config

This commit is contained in:
Mzhelskiy Maxim 2010-03-30 20:19:57 +00:00
parent 5ca9c8a44a
commit c8e2e5415a

View file

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