Definition at line 3 of file Munge.php.
◆ filter()
HTMLPurifier_URIFilter_Munge::filter |
( |
& |
$uri, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
- Parameters
-
- Returns
- bool
Definition at line 62 of file Munge.php.
References $doEmbed, and makeReplace().
68 $scheme_obj = $uri->getSchemeObj($config, $context);
72 if (!$scheme_obj->browsable) {
75 if ($uri->isBenign($config, $context)) {
80 $this->replace = array_map(
'rawurlencode', $this->replace);
82 $new_uri = strtr($this->target, $this->replace);
83 $new_uri = $this->parser->parse($new_uri);
86 if ($uri->host === $new_uri->host) {
makeReplace($uri, $config, $context)
◆ makeReplace()
HTMLPurifier_URIFilter_Munge::makeReplace |
( |
|
$uri, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
|
protected |
- Parameters
-
Definition at line 98 of file Munge.php.
Referenced by filter().
100 $string = $uri->toString();
102 $this->replace[
'%s'] = $string;
103 $this->replace[
'%r'] = $context->get(
'EmbeddedURI',
true);
104 $token = $context->get(
'CurrentToken',
true);
105 $this->replace[
'%n'] = $token ? $token->name : null;
106 $this->replace[
'%m'] = $context->get(
'CurrentAttr',
true);
107 $this->replace[
'%p'] = $context->get(
'CurrentCSSProperty',
true);
109 if ($this->secretKey) {
110 $this->replace[
'%t'] = hash_hmac(
"sha256", $string, $this->secretKey);
◆ prepare()
HTMLPurifier_URIFilter_Munge::prepare |
( |
|
$config | ) |
|
- Parameters
-
- Returns
- bool
Definition at line 44 of file Munge.php.
46 $this->target = $config->get(
'URI.' . $this->name);
48 $this->doEmbed = $config->get(
'URI.MungeResources');
49 $this->secretKey = $config->get(
'URI.MungeSecretKey');
50 if ($this->secretKey && !function_exists(
'hash_hmac')) {
51 throw new Exception(
"Cannot use %URI.MungeSecretKey without hash_hmac support.");
Parses a URI into the components and fragment identifier as specified by RFC 3986.
◆ $doEmbed
HTMLPurifier_URIFilter_Munge::$doEmbed |
|
private |
◆ $name
HTMLPurifier_URIFilter_Munge::$name = 'Munge' |
◆ $parser
HTMLPurifier_URIFilter_Munge::$parser |
|
private |
◆ $post
HTMLPurifier_URIFilter_Munge::$post = true |
◆ $replace
HTMLPurifier_URIFilter_Munge::$replace = array() |
|
protected |
◆ $secretKey
HTMLPurifier_URIFilter_Munge::$secretKey |
|
private |
◆ $target
HTMLPurifier_URIFilter_Munge::$target |
|
private |
The documentation for this class was generated from the following file:
- Services/Html/HtmlPurifier/library/HTMLPurifier/URIFilter/Munge.php