mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 06:07:26 +02:00
Remove decorator pattern from validator; we'll only have one decorator which invokes the subsystem.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1586 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
15
library/HTMLPurifier/ConfigSchema/Validator/IdExists.php
Normal file
15
library/HTMLPurifier/ConfigSchema/Validator/IdExists.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Validates that an ID field exists in the array
|
||||
*/
|
||||
class HTMLPurifier_ConfigSchema_Validator_IdExists extends HTMLPurifier_ConfigSchema_Validator
|
||||
{
|
||||
|
||||
public function validate(&$arr, $interchange, $type) {
|
||||
if (!isset($arr['ID'])) {
|
||||
throw new HTMLPurifier_ConfigSchema_Exception('ID must exist in ' . $type);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user