0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-23 17:01:51 +00:00
htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator/NamespaceExists.php
2008-03-04 05:21:04 +00:00

17 lines
509 B
PHP

<?php
/**
* Validates that the directive's namespace exists. Expects _NAMESPACE
* to have been created via HTMLPurifier_ConfigSchema_Validator_ParseId
*/
class HTMLPurifier_ConfigSchema_Validator_NamespaceExists extends HTMLPurifier_ConfigSchema_Validator
{
public function validate(&$arr, $interchange) {
if (!isset($interchange->namespaces[$arr['_NAMESPACE']])) {
$this->error('Cannot define directive for undefined namespace ' . $arr['_NAMESPACE']);
}
}
}