[3.1.0] Implement Duplicate validator, also modify some design things
[htmlpurifier.git] / library / HTMLPurifier / ConfigSchema / Validator / Exists.php
blobac36878d015208ecde9d1131eaf5743b777a1955
1 <?php
3 /**
4 * Validates that an field exists in the array
5 */
6 class HTMLPurifier_ConfigSchema_Validator_Exists extends HTMLPurifier_ConfigSchema_Validator
9 protected $index;
11 public function __construct($index) {
12 $this->index = $index;
15 public function validate(&$arr, $interchange) {
16 if (empty($arr[$this->index])) {
17 $this->error($this->index . ' must exist');