0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-09-20 11:15:18 +00:00
htmlpurifier/library/HTMLPurifier/ConfigSchema/Validator/IdExists.php

16 lines
371 B
PHP

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