- Rename Duplicate to Unique, as the name of validator indicates what we want the...
[htmlpurifier.git] / library / HTMLPurifier / ConfigSchema / Validator / Unique.php
blob6775f02540786579f61867f12182a5e60a3061c7
1 <?php
3 /**
4 * Validates that this ID does not exist already in the interchange object.
5 * @note
6 * Although this tests both possible values, in practice the ID
7 * will only be in one or the other. We do this to keep things simple.
8 */
9 class HTMLPurifier_ConfigSchema_Validator_Unique extends HTMLPurifier_ConfigSchema_Validator
12 public function validate(&$arr, $interchange) {
13 if (isset($interchange->namespaces[$arr['ID']])) {
14 $this->error('Cannot redefine namespace');
16 if (isset($interchange->directives[$arr['ID']])) {
17 $this->error('Cannot redefine directive');