mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 17:01:51 +00:00
4c798bd17e
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1596 48356398-32a2-884e-a903-53898d9a118a
22 lines
445 B
PHP
22 lines
445 B
PHP
<?php
|
|
|
|
/**
|
|
* Validates that an field exists in the array
|
|
*/
|
|
class HTMLPurifier_ConfigSchema_Validator_Exists extends HTMLPurifier_ConfigSchema_Validator
|
|
{
|
|
|
|
protected $index;
|
|
|
|
public function __construct($index) {
|
|
$this->index = $index;
|
|
}
|
|
|
|
public function validate(&$arr, $interchange) {
|
|
if (empty($arr[$this->index])) {
|
|
$this->error($this->index . ' must exist');
|
|
}
|
|
}
|
|
|
|
}
|