12 $this->target =
$config->get(
'URI.' . $this->name);
14 $this->doEmbed =
$config->get(
'URI.MungeResources');
15 $this->secretKey =
$config->get(
'URI.MungeSecretKey');
19 if ($context->get(
'EmbeddedURI',
true) && !
$this->doEmbed)
return true;
21 $scheme_obj = $uri->getSchemeObj(
$config, $context);
22 if (!$scheme_obj)
return true;
23 if (is_null($uri->host) || empty($scheme_obj->browsable)) {
27 if ($uri->host ===
$config->getDefinition(
'URI')->host) {
32 $this->replace = array_map(
'rawurlencode', $this->replace);
34 $new_uri = strtr($this->target, $this->replace);
35 $new_uri = $this->parser->parse($new_uri);
38 if ($uri->host === $new_uri->host)
return true;
44 $string = $uri->toString();
46 $this->replace[
'%s'] = $string;
47 $this->replace[
'%r'] = $context->get(
'EmbeddedURI',
true);
48 $token = $context->get(
'CurrentToken',
true);
49 $this->replace[
'%n'] = $token ? $token->name : null;
50 $this->replace[
'%m'] = $context->get(
'CurrentAttr',
true);
51 $this->replace[
'%p'] = $context->get(
'CurrentCSSProperty',
true);
53 if ($this->secretKey) $this->replace[
'%t'] = sha1($this->secretKey .
':' . $string);