Methods summary
public
|
|
public static
HTMLPurifier_Config
|
#
create( mixed $config, HTMLPurifier_ConfigSchema $schema = null )
Convenience constructor that creates a config object based on a mixed var
Convenience constructor that creates a config object based on a mixed var
Parameters
- $config
mixed $config 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 Schema object
Returns
|
public static
HTMLPurifier_Config
|
#
inherit( HTMLPurifier_Config $config )
Creates a new config object that inherits from a previous one.
Creates a new config object that inherits from a previous one.
Parameters
Returns
|
public static
HTMLPurifier_Config
|
#
createDefault( )
Convenience constructor that creates a default configuration object.
Convenience constructor that creates a default configuration object.
Returns
|
public
mixed
|
#
get( string $key, mixed $a = null )
Retrieves a value from the configuration.
Retrieves a value from the configuration.
Parameters
- $key
string $key String key
- $a
mixed $a
Returns
mixed
|
public
array
|
#
getBatch( string $namespace )
Retrieves an array of directives to values from a given namespace
Retrieves an array of directives to values from a given namespace
Parameters
- $namespace
string $namespace String namespace
Returns
array
|
public
string
|
#
getBatchSerial( string $namespace )
Returns a SHA-1 signature of a segment of the configuration object that
uniquely identifies that particular configuration
Returns a SHA-1 signature of a segment of the configuration object that
uniquely identifies that particular configuration
Parameters
- $namespace
string $namespace Namespace to get serial for
Returns
string
Note
Revision is handled specially and is removed from the batch before processing!
|
public
string
|
#
getSerial( )
Returns a SHA-1 signature for the entire configuration object that uniquely
identifies that particular configuration
Returns a SHA-1 signature for the entire configuration object that uniquely
identifies that particular configuration
Returns
string
|
public
|
#
getAll( )
Retrieves all directives, organized by namespace
Retrieves all directives, organized by namespace
Warning
This is a pretty inefficient function, avoid if you can
|
public
|
#
set( string $key, mixed $value, mixed $a = null )
Sets a value to configuration.
Sets a value to configuration.
Parameters
- $key
string $key key
- $value
mixed $value value
- $a
mixed $a
|
public
HTMLPurifier_HTMLDefinition
|
#
getHTMLDefinition( boolean $raw = false, boolean $optimized = false )
Retrieves object reference to the HTML definition.
Retrieves object reference to the HTML definition.
Parameters
- $raw
boolean $raw Return a copy that has not been setup yet. Must be called before it's been
setup, otherwise won't work.
- $optimized
boolean $optimized 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.
Returns
|
public
HTMLPurifier_CSSDefinition
|
#
getCSSDefinition( boolean $raw = false, boolean $optimized = false )
Retrieves object reference to the CSS definition
Retrieves object reference to the CSS definition
Parameters
- $raw
boolean $raw Return a copy that has not been setup yet. Must be called before it's been
setup, otherwise won't work.
- $optimized
boolean $optimized 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.
Returns
|
public
HTMLPurifier_URIDefinition
|
#
getURIDefinition( boolean $raw = false, boolean $optimized = false )
Retrieves object reference to the URI definition
Retrieves object reference to the URI definition
Parameters
- $raw
boolean $raw Return a copy that has not been setup yet. Must be called before it's been
setup, otherwise won't work.
- $optimized
boolean $optimized 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.
Returns
|
public
HTMLPurifier_Definition
|
#
getDefinition( string $type, boolean $raw = false, boolean $optimized = false )
Retrieves a definition
Parameters
- $type
string $type Type of definition: HTML, CSS, etc
- $raw
boolean $raw Whether or not definition should be returned raw
- $optimized
boolean $optimized 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."
Returns
Throws
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
loadArray( array $config_array )
Loads configuration values from an array with the following structure:
Namespace.Directive => Value
Loads configuration values from an array with the following structure:
Namespace.Directive => Value
Parameters
- $config_array
array $config_array Configuration associative array
|
public static
array
|
#
getAllowedDirectivesForForm( array $allowed, HTMLPurifier_ConfigSchema $schema = null )
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.
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.
Parameters
- $allowed
array $allowed List of allowed namespaces/directives
- $schema
HTMLPurifier_ConfigSchema
$schema Schema to use, if not global copy
Returns
array
|
public static
mixed
|
#
loadArrayFromForm( array $array, string|boolean $index = false, array|boolean $allowed = true, boolean $mq_fix = true, HTMLPurifier_ConfigSchema $schema = null )
Loads configuration values from $_GET/$_POST that were posted via
ConfigForm
Loads configuration values from $_GET/$_POST that were posted via
ConfigForm
Parameters
- $array
array $array $_GET or $_POST array to import
- $index
string|boolean $index Index/name that the config variables are in
- $allowed
array|boolean $allowed List of allowed namespaces/directives
- $mq_fix
boolean $mq_fix Boolean whether or not to enable magic quotes fix
- $schema
HTMLPurifier_ConfigSchema
$schema Schema to use, if not global copy
Returns
mixed
|
public
|
#
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.
Merges in configuration values from $_GET/$_POST to object. NOT STATIC.
Parameters
- $array
array $array $_GET or $_POST array to import
- $index
string|boolean $index Index/name that the config variables are in
- $allowed
array|boolean $allowed List of allowed namespaces/directives
- $mq_fix
boolean $mq_fix Boolean whether or not to enable magic quotes fix
|
public static
array
|
#
prepareArrayFromForm( array $array, string|boolean $index = false, array|boolean $allowed = true, boolean $mq_fix = true, HTMLPurifier_ConfigSchema $schema = null )
Prepares an array from a form into something usable for the more strict parts
of HTMLPurifier_Config
Prepares an array from a form into something usable for the more strict parts
of HTMLPurifier_Config
Parameters
- $array
array $array $_GET or $_POST array to import
- $index
string|boolean $index Index/name that the config variables are in
- $allowed
array|boolean $allowed List of allowed namespaces/directives
- $mq_fix
boolean $mq_fix Boolean whether or not to enable magic quotes fix
- $schema
HTMLPurifier_ConfigSchema
$schema Schema to use, if not global copy
Returns
array
|
public
|
#
loadIni( string $filename )
Loads configuration values from an ini file
Loads configuration values from an ini file
Parameters
- $filename
string $filename Name of ini file
|
public
boolean
|
#
isFinalized( string|boolean $error = false )
Checks whether or not the configuration object is finalized.
Checks whether or not the configuration object is finalized.
Parameters
- $error
string|boolean $error String error message, or false for no error
Returns
boolean
|
public
|
#
autoFinalize( )
Finalizes configuration only if auto finalize is on and not already
finalized
Finalizes configuration only if auto finalize is on and not already
finalized
|
public
|
#
finalize( )
Finalizes a configuration object, prohibiting further change
Finalizes a configuration object, prohibiting further change
|
protected
|
#
triggerError( string $msg, integer $no )
Produces a nicely formatted error message by supplying the stack frame
information OUTSIDE of HTMLPurifier_Config.
Produces a nicely formatted error message by supplying the stack frame
information OUTSIDE of HTMLPurifier_Config.
Parameters
- $msg
string $msg An error message
- $no
integer $no An error number
|
public
string
|
#
serialize( )
Returns a serialized form of the configuration object that can be
reconstituted.
Returns a serialized form of the configuration object that can be
reconstituted.
Returns
string
|