mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-05 13:47:24 +02:00
[3.1.0] Implement NamespaceExists and ParseId
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1599 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?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']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user