summaryrefslogtreecommitdiff
path: root/lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php
diff options
context:
space:
mode:
authorMichael Kuhn <[email protected]>2012-04-28 14:37:51 +0200
committerMichael Kuhn <[email protected]>2012-04-28 14:37:51 +0200
commitdd205fbad642ace6d0e33c8553f7d73404f140b4 (patch)
treec358d2c6749f953b4bdf5fe34ff9d1d9b0354f4a /lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php
parentf9c0fc6eb74440c761b9b12dd1684a1c1e52213c (diff)
Update HTML Purifier to version 4.4.0.
Diffstat (limited to 'lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php')
-rw-r--r--lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php b/lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php
index efa10a645..de695df14 100644
--- a/lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php
+++ b/lib/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php
@@ -20,13 +20,8 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter
$scheme_obj = $uri->getSchemeObj($config, $context);
if (!$scheme_obj) return true; // ignore unknown schemes, maybe another postfilter did it
- if (is_null($uri->host) || empty($scheme_obj->browsable)) {
- return true;
- }
- // don't redirect if target host is our host
- if ($uri->host === $config->getDefinition('URI')->host) {
- return true;
- }
+ if (!$scheme_obj->browsable) return true; // ignore non-browseable schemes, since we can't munge those in a reasonable way
+ if ($uri->isBenign($config, $context)) return true; // don't redirect if a benign URL
$this->makeReplace($uri, $config, $context);
$this->replace = array_map('rawurlencode', $this->replace);