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

16 lines
371 B
PHP
Raw Normal View History

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