aboutsummaryrefslogtreecommitdiffstats
path: root/lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-07-18 03:59:10 -0700
committerfriendica <info@friendica.com>2012-07-18 03:59:10 -0700
commit22cf19e174bcee88b44968f2773d1bad2da2b54d (patch)
treef4e01db6f73754418438b020c2327e18c256653c /lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php
parent7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a (diff)
downloadvolse-hubzilla-22cf19e174bcee88b44968f2773d1bad2da2b54d.tar.gz
volse-hubzilla-22cf19e174bcee88b44968f2773d1bad2da2b54d.tar.bz2
volse-hubzilla-22cf19e174bcee88b44968f2773d1bad2da2b54d.zip
bad sync with github windows client
Diffstat (limited to 'lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php')
-rw-r--r--lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php68
1 files changed, 0 insertions, 68 deletions
diff --git a/lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php b/lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php
deleted file mode 100644
index 576bf7b6d..000000000
--- a/lib/htmlpurifier/library/HTMLPurifier/URISchemeRegistry.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-/**
- * Registry for retrieving specific URI scheme validator objects.
- */
-class HTMLPurifier_URISchemeRegistry
-{
-
- /**
- * Retrieve sole instance of the registry.
- * @param $prototype Optional prototype to overload sole instance with,
- * or bool true to reset to default registry.
- * @note Pass a registry object $prototype with a compatible interface and
- * the function will copy it and return it all further times.
- */
- public static function instance($prototype = null) {
- static $instance = null;
- if ($prototype !== null) {
- $instance = $prototype;
- } elseif ($instance === null || $prototype == true) {
- $instance = new HTMLPurifier_URISchemeRegistry();
- }
- return $instance;
- }
-
- /**
- * Cache of retrieved schemes.
- */
- protected $schemes = array();
-
- /**
- * Retrieves a scheme validator object
- * @param $scheme String scheme name like http or mailto
- * @param $config HTMLPurifier_Config object
- * @param $config HTMLPurifier_Context object
- */
- public function getScheme($scheme, $config, $context) {
- if (!$config) $config = HTMLPurifier_Config::createDefault();
-
- // important, otherwise attacker could include arbitrary file
- $allowed_schemes = $config->get('URI.AllowedSchemes');
- if (!$config->get('URI.OverrideAllowedSchemes') &&
- !isset($allowed_schemes[$scheme])
- ) {
- return;
- }
-
- if (isset($this->schemes[$scheme])) return $this->schemes[$scheme];
- if (!isset($allowed_schemes[$scheme])) return;
-
- $class = 'HTMLPurifier_URIScheme_' . $scheme;
- if (!class_exists($class)) return;
- $this->schemes[$scheme] = new $class();
- return $this->schemes[$scheme];
- }
-
- /**
- * Registers a custom scheme to the cache, bypassing reflection.
- * @param $scheme Scheme name
- * @param $scheme_obj HTMLPurifier_URIScheme object
- */
- public function register($scheme, $scheme_obj) {
- $this->schemes[$scheme] = $scheme_obj;
- }
-
-}
-
-// vim: et sw=4 sts=4