mirror of
https://github.com/leonelquinteros/php-toml.git
synced 2025-01-16 20:08:17 +01:00
Fix escaping check. Fixes #8
This commit is contained in:
parent
32b557a1e6
commit
a24ca62c9e
@ -368,12 +368,12 @@ class Toml
|
||||
$openLString = !$openLString;
|
||||
}
|
||||
}
|
||||
elseif($toml[$i] == "\\" && !in_array($toml[$i+1], array('b', 't', 'n', 'f', 'r', 'u', 'U', '"', "\\", ' ')))
|
||||
elseif($toml[$i] == "\\" && $toml[$i-1] != "\\" && !in_array($toml[$i+1], array('b', 't', 'n', 'f', 'r', 'u', 'U', '"', "\\", ' ')))
|
||||
{
|
||||
// Reserved special characters inside strings should produce error
|
||||
if($openString)
|
||||
{
|
||||
throw new Exception('Reserved special characters inside strings are not allowed: ' . $toml[$i] . $toml[$i+1]);
|
||||
throw new Exception('Reserved special characters inside strings are not allowed: ' . $toml[$i] . $toml[$i+1]);
|
||||
}
|
||||
|
||||
// Cleanup escaped new lines and whitespaces from multi-line strings
|
||||
|
@ -244,4 +244,8 @@ color = "gray"
|
||||
|
||||
[[fruit.variety]]
|
||||
name = "plantain"
|
||||
|
||||
|
||||
|
||||
|
||||
[user.contributed.cases]
|
||||
slashes="SERVER\\MASTER"
|
||||
|
Loading…
x
Reference in New Issue
Block a user