parent
403c2d3495
commit
769d490631
|
@ -157,11 +157,10 @@ class Directive
|
|||
{
|
||||
$str = trim($str);
|
||||
$str = str_replace('\\', '\\\\', $str);
|
||||
$str = str_replace('"', '\\"', $str);
|
||||
$str = str_replace('"', '\"', $str);
|
||||
$str = str_replace("\r", '\r', $str);
|
||||
$str = str_replace("\n", '\n', $str);
|
||||
|
||||
// line breaks in the value should always match the current system EOL sequence
|
||||
// to assure editable configuration files
|
||||
$str = preg_replace("/(\r\n)|(\n)/", PHP_EOL, $str);
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -284,8 +284,8 @@ class IniParser
|
|||
*/
|
||||
protected static function unescapeSectionName($str)
|
||||
{
|
||||
$str = str_replace('\\"', '"', $str);
|
||||
$str = str_replace('\\;', ';', $str);
|
||||
$str = str_replace('\"', '"', $str);
|
||||
$str = str_replace('\;', ';', $str);
|
||||
|
||||
return str_replace('\\\\', '\\', $str);
|
||||
}
|
||||
|
@ -299,8 +299,11 @@ class IniParser
|
|||
*/
|
||||
protected static function unescapeOptionValue($str)
|
||||
{
|
||||
$str = str_replace('\\"', '"', $str);
|
||||
$str = str_replace('\n', "\n", $str);
|
||||
$str = str_replace('\r', "\r", $str);
|
||||
$str = str_replace('\"', '"', $str);
|
||||
$str = str_replace('\\\\', '\\', $str);
|
||||
|
||||
return str_replace('\\\\', '\\', $str);
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue