validators[] = $validator; } public function validate(&$arr, $interchange) { $exceptions = array(); $pass = false; foreach ($this->validators as $validator) { try { $validator->validate($arr, $interchange); } catch (HTMLPurifier_ConfigSchema_Exception $e) { $exceptions[] = $e; continue; } $exceptions = array(); break; } if ($exceptions) { // I wonder how we can make the exceptions "lossless" throw new HTMLPurifier_ConfigSchema_Exception('All validators failed: ' . implode(";\n", $exceptions)); } } }