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

16 lines
394 B
PHP

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