Browse Source

Start on validating config

master
J. King 1 year ago
parent
commit
24bfd4cdc5
  1. 11
      lib/AbstractSanitizer.php

11
lib/AbstractSanitizer.php

@ -399,7 +399,7 @@ abstract class AbstractSanitizer {
* - `name`: The localName of the element
* - `namespace`: The namespaceURI of the element, a string or null. If omitted the HTML namespace is assumed
*
* The entries in attribute lists are arrays with the follwoing keys
* The entries in attribute lists are arrays with the following keys
*
* - `name`: The localName of the attribute
* - `namespace`: The namespaceURI of the attribute. If omitted the null namespace is assumed
@ -408,5 +408,14 @@ abstract class AbstractSanitizer {
* @param array $config A configuration to use instead of the default one
*/
public function __construct(array $config = null) {
if ($config === null) {
// use the default configuration if none is specified
$this->config = self::DEFAULT_CONF;
} else {
// otherwise validate the configuration; the specification provides
// no clue is to what happens when the configuration is invalid,
// so we'll just have to do our best
$conf = [];
}
}
}

Loading…
Cancel
Save