1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-10 01:06:20 +02:00

- Modify hash format to be more intuitive

- Add parameter that controls magic quotes processing in loadArrayFromForm

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1107 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-05-28 03:55:36 +00:00
parent 8913239b7f
commit dea62ffdab
5 changed files with 15 additions and 9 deletions

View File

@ -347,10 +347,12 @@ class HTMLPurifier_ConfigSchema {
// remove spaces
foreach ($var as $i => $j) $var[$i] = trim($j);
if ($type === 'hash') {
// key,value,key,value
// key:value,key2:value2
$nvar = array();
for ($i = 0, $c = count($var); $i + 1 < $c; $i += 2) {
$nvar[$var[$i]] = $var[$i + 1];
foreach ($var as $keypair) {
$c = explode(':', $keypair, 2);
if (!isset($c[1])) continue;
$nvar[$c[0]] = $c[1];
}
$var = $nvar;
}