HTMLPurifier_PercentEncoder
in package
Class that handles operations involving percent-encoding in URIs.
Tags
Table of Contents
Properties
- $preserve : mixed
- Reserved characters to preserve when using encode().
Methods
- __construct() : mixed
- String of characters that should be preserved while using encode().
- encode() : string
- Our replacement for urlencode, it encodes all non-reserved characters, as well as any extra characters that were instructed to be preserved.
- normalize() : string
- Fix up percent-encoding by decoding unreserved characters and normalizing.
Properties
$preserve
Reserved characters to preserve when using encode().
protected
mixed
$preserve
= array()
Tags
Methods
__construct()
String of characters that should be preserved while using encode().
public
__construct([bool $preserve = false ]) : mixed
Parameters
- $preserve : bool = false
encode()
Our replacement for urlencode, it encodes all non-reserved characters, as well as any extra characters that were instructed to be preserved.
public
encode(string $string) : string
Parameters
- $string : string
-
String to be encoded
Tags
Return values
string —Encoded string.
normalize()
Fix up percent-encoding by decoding unreserved characters and normalizing.
public
normalize(string $string) : string
Parameters
- $string : string
-
String to normalize