mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-30 19:00:10 +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:
15
library/HTMLPurifier/ConfigSchema/Validator/ParseId.php
Normal file
15
library/HTMLPurifier/ConfigSchema/Validator/ParseId.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Parses ID into NAMESPACE and, if appropriate, DIRECTIVE. Expects ID to exist.
|
||||
*/
|
||||
class HTMLPurifier_ConfigSchema_Validator_ParseId extends HTMLPurifier_ConfigSchema_Validator
|
||||
{
|
||||
|
||||
public function validate(&$arr, $interchange) {
|
||||
$r = explode('.', $arr['ID'], 2);
|
||||
$arr['_NAMESPACE'] = $r[0];
|
||||
if (isset($r[1])) $arr['_DIRECTIVE'] = $r[1];
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user