1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 06:07:26 +02:00

[3.1.0] Create decorator validator/adapter for Interchange.

- Output flush output

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1587 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-03-02 04:00:43 +00:00
parent d81bcbd208
commit 0d9c05d13c
7 changed files with 99 additions and 24 deletions

View File

@@ -11,7 +11,7 @@ class HTMLPurifier_ConfigSchema_Interchange
/**
* Hash table of allowed types.
*/
private $types = array(
public $types = array(
'string' => 'String',
'istring' => 'Case-insensitive string',
'text' => 'Text',
@@ -28,29 +28,12 @@ class HTMLPurifier_ConfigSchema_Interchange
/**
* Array of Namespace ID => array(namespace info)
*/
private $namespaces;
public $namespaces;
/**
* Array of Directive ID => array(directive info)
*/
private $directives;
/** Get all namespaces */
public function getNamespaces() {return $this->namespaces;}
/** Get a namespace */
public function getNamespace($id) {return $this->namespaces[$id];}
/** Check if a namespace exists */
public function namespaceExists($id) {return isset($this->namespaces[$id]);}
/** Get all directives */
public function getDirectives() {return $this->directives;}
/** Get a directive */
public function getDirective($id) {return $this->directives[$id];}
/** Check if a directive exists */
public function directiveExists($id) {return isset($this->directives[$id]);}
/** Get all types */
public function getTypes() {return $this->types;}
public $directives;
/**
* Adds a namespace array to $namespaces
@@ -71,7 +54,9 @@ class HTMLPurifier_ConfigSchema_Interchange
* to be used for data-input.
*/
public function getValidatorAdapter() {
$validator = new HTMLPurifier_ConfigSchema_InterchangeValidator($this);
$validator->addValidator(new HTMLPurifier_ConfigSchema_Validator_IdExists());
return $validator;
}
}