mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 06:07:26 +02:00
Implement composite validator, and make Interchange use that.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1606 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
21
library/HTMLPurifier/ConfigSchema/Validator/Composite.php
Normal file
21
library/HTMLPurifier/ConfigSchema/Validator/Composite.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Groups several validators together, which can be used with logical validators
|
||||
*/
|
||||
class HTMLPurifier_ConfigSchema_Validator_Composite extends HTMLPurifier_ConfigSchema_Validator
|
||||
{
|
||||
|
||||
protected $validators = array();
|
||||
|
||||
public function addValidator($validator) {
|
||||
$this->validators[] = $validator;
|
||||
}
|
||||
|
||||
public function validate(&$arr, $interchange) {
|
||||
foreach ($this->validators as $validator) {
|
||||
$validator->validate($arr, $interchange);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user