mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-10 01:06:20 +02:00
Allow empty sections in string hashes; previously they were left undefined.
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
@ -78,6 +78,7 @@ class HTMLPurifier_StringHashParser
|
||||
if (strncmp('--', $line, 2) === 0) {
|
||||
// Multiline declaration
|
||||
$state = trim($line, '- ');
|
||||
if (!isset($ret[$state])) $ret[$state] = '';
|
||||
continue;
|
||||
} elseif (!$state) {
|
||||
$single = true;
|
||||
@ -94,7 +95,6 @@ class HTMLPurifier_StringHashParser
|
||||
$single = false;
|
||||
$state = false;
|
||||
} else {
|
||||
if (!isset($ret[$state])) $ret[$state] = '';
|
||||
$ret[$state] .= "$line\n";
|
||||
}
|
||||
} while (!feof($fh));
|
||||
|
Reference in New Issue
Block a user