$j) $var[$i] = trim($j); if ($type === 'hash') { // key:value,key2:value2 $nvar = array(); foreach ($var as $keypair) { $c = explode(':', $keypair, 2); if (!isset($c[1])) continue; $nvar[$c[0]] = $c[1]; } $var = $nvar; } } if (!is_array($var)) break; $keys = array_keys($var); if ($keys === array_keys($keys)) { if ($type == 'list') return $var; elseif ($type == 'lookup') { $new = array(); foreach ($var as $key) { $new[$key] = true; } return $new; } else break; } if ($type === 'lookup') { foreach ($var as $key => $value) { $var[$key] = true; } } return $var; default: // This should not happen! throw new HTMLPurifier_Exception("Inconsistency in HTMLPurifier_VarParser_Flexible: $type is not implemented"); } throw new HTMLPurifier_VarParserException("Invalid input for type $type"); } }