1
0
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:
Edward Z. Yang
2008-07-04 21:26:26 -04:00
parent aa0fdeee30
commit a227cb483a
4 changed files with 5 additions and 1 deletions

View File

@ -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));