Property | Type | Description | |
---|---|---|---|
$autoFinalize | Whether or not to automatically finalize the object if a read operation is done. | ||
$chatty | (useful when unit testing). This will also compress some errors and exceptions. | ||
$def | Reference HTMLPurifier_ConfigSchema for value checking. | ||
$version | HTML Purifier's version |
Property | Type | Description | |
---|---|---|---|
$definitions | Indexed array of definitions. | ||
$finalized | Whether or not config is finalized. | ||
$parser | Parser for variables. | ||
$plist | Property list containing configuration directives. | ||
$serial | Serial for entire configuration object. | ||
$serials | Namespace indexed array of serials for specific namespaces. |
Method | Description | |
---|---|---|
__construct ( HTMLPurifier_ConfigSchema $definition, HTMLPurifier_PropertyList $parent = null ) | Constructor | |
autoFinalize ( ) | Finalizes configuration only if auto finalize is on and not already finalized | |
create ( mixed $config, HTMLPurifier_ConfigSchema $schema = null ) : HTMLPurifier_Config | Convenience constructor that creates a config object based on a mixed var | |
createDefault ( ) : HTMLPurifier_Config | Convenience constructor that creates a default configuration object. | |
finalize ( ) | Finalizes a configuration object, prohibiting further change | |
get ( string $key, mixed $a = null ) : mixed | Retrieves a value from the configuration. | |
getAll ( ) | Retrieves all directives, organized by namespace | |
getAllowedDirectivesForForm ( array $allowed, HTMLPurifier_ConfigSchema $schema = null ) : array | Returns a list of array(namespace, directive) for all directives that are allowed in a web-form context as per an allowed namespaces/directives list. | |
getBatch ( string $namespace ) : array | Retrieves an array of directives to values from a given namespace | |
getBatchSerial ( string $namespace ) : string | Returns a SHA-1 signature of a segment of the configuration object that uniquely identifies that particular configuration | |
getCSSDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_CSSDefinition | Retrieves object reference to the CSS definition | |
getDefinition ( string $type, boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_Definition | Retrieves a definition | |
getHTMLDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_HTMLDefinition | Retrieves object reference to the HTML definition. | |
getSerial ( ) : string | Returns a SHA-1 signature for the entire configuration object that uniquely identifies that particular configuration | |
getURIDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_URIDefinition | Retrieves object reference to the URI definition | |
inherit ( HTMLPurifier_Config $config ) : HTMLPurifier_Config | Creates a new config object that inherits from a previous one. | |
isFinalized ( string | boolean $error = false ) : boolean | Checks whether or not the configuration object is finalized. | |
loadArray ( array $config_array ) | Loads configuration values from an array with the following structure: Namespace.Directive => Value | |
loadArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true, HTMLPurifier_ConfigSchema $schema = null ) : mixed | Loads configuration values from $_GET/$_POST that were posted via ConfigForm | |
loadIni ( string $filename ) | Loads configuration values from an ini file | |
maybeGetRawCSSDefinition ( ) : HTMLPurifier_CSSDefinition | ||
maybeGetRawDefinition ( $name ) | ||
maybeGetRawHTMLDefinition ( ) : HTMLPurifier_HTMLDefinition | ||
maybeGetRawURIDefinition ( ) : HTMLPurifier_URIDefinition | ||
mergeArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true ) | Merges in configuration values from $_GET/$_POST to object. NOT STATIC. | |
prepareArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true, HTMLPurifier_ConfigSchema $schema = null ) : array | Prepares an array from a form into something usable for the more strict parts of HTMLPurifier_Config | |
serialize ( ) : string | Returns a serialized form of the configuration object that can be reconstituted. | |
set ( string $key, mixed $value, mixed $a = null ) | Sets a value to configuration. |
Method | Description | |
---|---|---|
triggerError ( string $msg, integer $no ) | Produces a nicely formatted error message by supplying the stack frame information OUTSIDE of HTMLPurifier_Config. |
Method | Description | |
---|---|---|
_listify ( array $lookup ) : string | Convenience function for error reporting | |
initDefinition ( string $type ) : HTMLPurifier_CSSDefinition | HTMLPurifier_HTMLDefinition | HTMLPurifier_URIDefinition | Initialise definition |
public __construct ( HTMLPurifier_ConfigSchema $definition, HTMLPurifier_PropertyList $parent = null ) | ||
$definition | HTMLPurifier_ConfigSchema | ConfigSchema that defines what directives are allowed. |
$parent | HTMLPurifier_PropertyList |
public autoFinalize ( ) |
public static create ( mixed $config, HTMLPurifier_ConfigSchema $schema = null ) : HTMLPurifier_Config | ||
$config | mixed | Variable that defines the state of the config object. Can be: a HTMLPurifier_Config() object, an array of directives based on loadArray(), or a string filename of an ini file. |
$schema | HTMLPurifier_ConfigSchema | Schema object |
return | HTMLPurifier_Config | Configured object |
public static createDefault ( ) : HTMLPurifier_Config | ||
return | HTMLPurifier_Config | default object. |
public finalize ( ) |
public static getAllowedDirectivesForForm ( array $allowed, HTMLPurifier_ConfigSchema $schema = null ) : array | ||
$allowed | array | List of allowed namespaces/directives |
$schema | HTMLPurifier_ConfigSchema | Schema to use, if not global copy |
return | array |
public getBatchSerial ( string $namespace ) : string | ||
$namespace | string | Namespace to get serial for |
return | string |
public getCSSDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_CSSDefinition | ||
$raw | boolean | Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work. |
$optimized | boolean | If true, this method may return null, to indicate that a cached version of the modified definition object is available and no further edits are necessary. Consider using maybeGetRawCSSDefinition, which is more explicitly named, instead. |
return | HTMLPurifier_CSSDefinition |
public getDefinition ( string $type, boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_Definition | ||
$type | string | Type of definition: HTML, CSS, etc |
$raw | boolean | Whether or not definition should be returned raw |
$optimized | boolean | Only has an effect when $raw is true. Whether or not to return null if the result is already present in the cache. This is off by default for backwards compatibility reasons, but you need to do things this way in order to ensure that caching is done properly. Check out enduser-customize.html for more details. We probably won't ever change this default, as much as the maybe semantics is the "right thing to do." |
return | HTMLPurifier_Definition |
public getHTMLDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_HTMLDefinition | ||
$raw | boolean | Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work. |
$optimized | boolean | If true, this method may return null, to indicate that a cached version of the modified definition object is available and no further edits are necessary. Consider using maybeGetRawHTMLDefinition, which is more explicitly named, instead. |
return | HTMLPurifier_HTMLDefinition |
public getURIDefinition ( boolean $raw = false, boolean $optimized = false ) : HTMLPurifier_URIDefinition | ||
$raw | boolean | Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work. |
$optimized | boolean | If true, this method may return null, to indicate that a cached version of the modified definition object is available and no further edits are necessary. Consider using maybeGetRawURIDefinition, which is more explicitly named, instead. |
return | HTMLPurifier_URIDefinition |
public static inherit ( HTMLPurifier_Config $config ) : HTMLPurifier_Config | ||
$config | HTMLPurifier_Config | Configuration object to inherit from. |
return | HTMLPurifier_Config | object with $config as its parent. |
public static loadArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true, HTMLPurifier_ConfigSchema $schema = null ) : mixed | ||
$array | array | $_GET or $_POST array to import |
$index | string | boolean | Index/name that the config variables are in |
$allowed | array | boolean | List of allowed namespaces/directives |
$mq_fix | boolean | Boolean whether or not to enable magic quotes fix |
$schema | HTMLPurifier_ConfigSchema | Schema to use, if not global copy |
return | mixed |
public maybeGetRawCSSDefinition ( ) : HTMLPurifier_CSSDefinition | ||
return | HTMLPurifier_CSSDefinition |
public maybeGetRawHTMLDefinition ( ) : HTMLPurifier_HTMLDefinition | ||
return | HTMLPurifier_HTMLDefinition |
public maybeGetRawURIDefinition ( ) : HTMLPurifier_URIDefinition | ||
return | HTMLPurifier_URIDefinition |
public mergeArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true ) | ||
$array | array | $_GET or $_POST array to import |
$index | string | boolean | Index/name that the config variables are in |
$allowed | array | boolean | List of allowed namespaces/directives |
$mq_fix | boolean | Boolean whether or not to enable magic quotes fix |
public static prepareArrayFromForm ( array $array, string | boolean $index = false, array | boolean $allowed = true, boolean $mq_fix = true, HTMLPurifier_ConfigSchema $schema = null ) : array | ||
$array | array | $_GET or $_POST array to import |
$index | string | boolean | Index/name that the config variables are in |
$allowed | array | boolean | List of allowed namespaces/directives |
$mq_fix | boolean | Boolean whether or not to enable magic quotes fix |
$schema | HTMLPurifier_ConfigSchema | Schema to use, if not global copy |
return | array |
protected triggerError ( string $msg, integer $no ) | ||
$msg | string | An error message |
$no | integer | An error number |
public $autoFinalize |
public $chatty |
protected $serials |