\HTMLPurifier_VarParser_Flexible
Performs safe variable parsing based on types which can be used by users. This may not be able to represent all possible data inputs, however.
Synopsis
class HTMLPurifier_VarParser_Flexible
extends HTMLPurifier_VarParser
{
- // Inherited constants from HTMLPurifier_VarParser
- const STRING = 1;
- const ISTRING = 2;
- const TEXT = 3;
- const ITEXT = 4;
- const INT = 5;
- const FLOAT = 6;
- const BOOL = 7;
- const LOOKUP = 8;
- const ALIST = 9;
- const HASH = 10;
- const MIXED = 11;
- // Inherited members from HTMLPurifier_VarParser
- public static array $types;
- public static array $stringTypes;
- // methods
- protected void parseImplementation()
- // Inherited methods from HTMLPurifier_VarParser
- public final Validated parse()
- protected void parseImplementation()
- protected void error()
- protected void errorInconsistent()
- protected void errorGeneric()
- public static void getTypeName()
Hierarchy
Extends
Constants
Name | Value |
---|---|
STRING | 1 |
ISTRING | 2 |
TEXT | 3 |
ITEXT | 4 |
INT | 5 |
FLOAT | 6 |
BOOL | 7 |
LOOKUP | 8 |
ALIST | 9 |
HASH | 10 |
MIXED | 11 |
Members
public
-
$stringTypes
Lookup table of types that are string, and can have aliases or allowed value lists. -
$types
Lookup table of allowed types. Mainly for backwards compatibility, but also convenient for transforming string type names to the integer constants.
Methods
protected
Inherited from HTMLPurifier_VarParser
protected
- error() — Throws an exception.
- errorGeneric() — Generic error for if a type didn't work.
- errorInconsistent() — Throws an inconsistency exception.
- parseImplementation() — Actually implements the parsing. Base implementation is to not do anything to $var. Subclasses should overload this!
public
- getTypeName()
- parse() — Validate a variable according to type. Throws HTMLPurifier_VarParserException if invalid.