Class HTMLPurifier_PercentEncoder

InheritanceHTMLPurifier_PercentEncoder

Class that handles operations involving percent-encoding in URIs.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$preserve Reserved characters to preserve when using encode(). HTMLPurifier_PercentEncoder

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() String of characters that should be preserved while using encode(). HTMLPurifier_PercentEncoder
encode() Our replacement for urlencode, it encodes all non-reserved characters, as well as any extra characters that were instructed to be preserved. HTMLPurifier_PercentEncoder
normalize() Fix up percent-encoding by decoding unreserved characters and normalizing. HTMLPurifier_PercentEncoder

Property Details

$preserve protected property
protected $preserve = []

Method Details

__construct() public method

String of characters that should be preserved while using encode().

public void __construct ( $preserve false )
$preserve bool
encode() public method

Our replacement for urlencode, it encodes all non-reserved characters, as well as any extra characters that were instructed to be preserved.

public string encode ( $string )
$string string

String to be encoded

return string

Encoded string.

normalize() public method

Fix up percent-encoding by decoding unreserved characters and normalizing.

public string normalize ( $string )
$string string

String to normalize