mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-10 15:48:42 +00:00
17 lines
509 B
PHP
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']);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|