summaryrefslogtreecommitdiff
path: root/lib/htmlpurifier/library/HTMLPurifier/URI.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-06-05 21:52:37 +0400
committerAndrew Dolgov <[email protected]>2012-06-05 21:52:37 +0400
commitcb73535c8eae02092df984bafbecabbce8049cd0 (patch)
tree2a9a68d5c636381a7617fb0dc50a66f87758e9e9 /lib/htmlpurifier/library/HTMLPurifier/URI.php
parent010efc9b814b433bc60353caec185d905688a32b (diff)
Revert "Update HTML Purifier to version 4.4.0."
This reverts commit dd205fbad642ace6d0e33c8553f7d73404f140b4.
Diffstat (limited to 'lib/htmlpurifier/library/HTMLPurifier/URI.php')
-rw-r--r--lib/htmlpurifier/library/HTMLPurifier/URI.php40
1 files changed, 1 insertions, 39 deletions
diff --git a/lib/htmlpurifier/library/HTMLPurifier/URI.php b/lib/htmlpurifier/library/HTMLPurifier/URI.php
index f158ef5e3..efdfb2c68 100644
--- a/lib/htmlpurifier/library/HTMLPurifier/URI.php
+++ b/lib/htmlpurifier/library/HTMLPurifier/URI.php
@@ -40,7 +40,7 @@ class HTMLPurifier_URI
} else {
// no scheme: retrieve the default one
$def = $config->getDefinition('URI');
- $scheme_obj = $def->getDefaultScheme($config, $context);
+ $scheme_obj = $registry->getScheme($def->defaultScheme, $config, $context);
if (!$scheme_obj) {
// something funky happened to the default scheme object
trigger_error(
@@ -199,44 +199,6 @@ class HTMLPurifier_URI
return $result;
}
- /**
- * Returns true if this URL might be considered a 'local' URL given
- * the current context. This is true when the host is null, or
- * when it matches the host supplied to the configuration.
- *
- * Note that this does not do any scheme checking, so it is mostly
- * only appropriate for metadata that doesn't care about protocol
- * security. isBenign is probably what you actually want.
- */
- public function isLocal($config, $context) {
- if ($this->host === null) return true;
- $uri_def = $config->getDefinition('URI');
- if ($uri_def->host === $this->host) return true;
- return false;
- }
-
- /**
- * Returns true if this URL should be considered a 'benign' URL,
- * that is:
- *
- * - It is a local URL (isLocal), and
- * - It has a equal or better level of security
- */
- public function isBenign($config, $context) {
- if (!$this->isLocal($config, $context)) return false;
-
- $scheme_obj = $this->getSchemeObj($config, $context);
- if (!$scheme_obj) return false; // conservative approach
-
- $current_scheme_obj = $config->getDefinition('URI')->getDefaultScheme($config, $context);
- if ($current_scheme_obj->secure) {
- if (!$scheme_obj->secure) {
- return false;
- }
- }
- return true;
- }
-
}
// vim: et sw=4 sts=4