mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
- use single quotes in config.php to avoid possible malformed strings (fixes GH-40)
This commit is contained in:
parent
82fcbcb6ba
commit
157c8ebd33
1 changed files with 6 additions and 6 deletions
|
|
@ -300,14 +300,14 @@ class Config
|
|||
if (!preg_match("/^[a-zA-Z0-9_]+$/", $key)) {
|
||||
throw new Exception("Unexpected constant name: ". $key);
|
||||
}
|
||||
if (preg_match('~\R~', $value)) {
|
||||
if (preg_match('~\R~', $value)) { # newlines
|
||||
throw new Exception("Unexpected constant value: ". $value);
|
||||
}
|
||||
return "define(\"$key\", \"". str_replace(
|
||||
array("\\", "'", "\""),
|
||||
array("\\\\", "\\'", "\\\""),
|
||||
$value )
|
||||
. "\");";
|
||||
return "define('$key', '". str_replace(
|
||||
array("\\", "'" ),
|
||||
array("\\\\", "\\'"),
|
||||
$value
|
||||
) . "');";
|
||||
}
|
||||
|
||||
public static function saveDbConfig()
|
||||
|
|
|
|||
Loading…
Reference in a new issue