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.");
72 if (!$scheme_obj->browsable) {
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) {
100 $string = $uri->toString();
102 $this->replace[
'%s'] = $string;
103 $this->replace[
'%r'] =
$context->get(
'EmbeddedURI',
true);
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);
filter(&$uri, $config, $context)
Chainable filters for custom URI processing.
$parser
HTMLPurifier_URIParser
makeReplace($uri, $config, $context)
Parses a URI into the components and fragment identifier as specified by RFC 3986.