0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-20 19:25:19 +00:00
htmlpurifier/library/HTMLPurifier/ConfigSchema/Interchange/Validator/IdExists.php
Edward Z. Yang 8bda0c4dfb [3.1.0] Refactor out validation framework for Interchange
- Implement IdExists validator

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1584 48356398-32a2-884e-a903-53898d9a118a
2008-03-02 01:55:14 +00:00

21 lines
569 B
PHP

<?php
class HTMLPurifier_ConfigSchema_Interchange_Validator_IdExists extends HTMLPurifier_ConfigSchema_Interchange_Validator
{
public function addNamespace($arr) {
if (!isset($arr['ID'])) {
throw new HTMLPurifier_ConfigSchema_Exception('Namespace must have ID');
}
parent::addNamespace($arr);
}
public function addDirective($arr) {
if (!isset($arr['ID'])) {
throw new HTMLPurifier_ConfigSchema_Exception('Directive must have ID');
}
parent::addDirective($arr);
}
}