added a new option, to filter the allowed attribute values by regular expression

This commit is contained in:
Lars Kneschke 2006-08-29 18:45:17 +00:00
parent a1abed870a
commit 4bc6ad098e

View File

@ -329,6 +329,7 @@
foreach ($attrarr as $arreach) foreach ($attrarr as $arreach)
{ {
$current = $this->allowed_html[strtolower($element)][strtolower($arreach['name'])]; $current = $this->allowed_html[strtolower($element)][strtolower($arreach['name'])];
if ($current == '') if ($current == '')
{ {
# the attribute is not allowed # the attribute is not allowed
@ -623,6 +624,14 @@
} }
break; break;
# The minval check checks that the attribute value is a positive integer,
# and that it is not smaller than the given value.
case 'match':
if (!preg_match($checkvalue, $value)) {
$ok = false;
}
break;
} # switch } # switch
return $ok; return $ok;