0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-14 01:08:41 +00:00
htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator/NamespaceExists.php

17 lines
509 B
PHP
Raw Normal View History

<?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']);
}
}
}