1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-05 05:37:49 +02:00

[3.1.0] Implement more validators, add in missing DEFAULTs for many tests.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1626 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-03-23 01:29:57 +00:00
parent aedfbd1e93
commit 82c9a737f4
11 changed files with 72 additions and 17 deletions

View File

@@ -36,7 +36,7 @@ class HTMLPurifier_VarParser
*/
final public function parse($var, $type, $allow_null = false) {
if (!isset(HTMLPurifier_VarParser::$types[$type])) {
throw new HTMLPurifier_VarParserException("Invalid type $type");
throw new HTMLPurifier_VarParserException("Invalid type '$type'");
}
$var = $this->parseImplementation($var, $type, $allow_null);
if ($allow_null && $var === null) return null;
@@ -73,7 +73,7 @@ class HTMLPurifier_VarParser
case 'mixed':
return $var;
default:
$this->errorInconsistent(__CLASS__, $type);
$this->errorInconsistent(get_class($this), $type);
}
$this->errorGeneric($var, $type);
}