0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-24 17:21:52 +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);
}
}
}