17 public static function instance($prototype = null)
19 static $instance = null;
20 if ($prototype !== null) {
21 $instance = $prototype;
22 } elseif ($instance === null || $prototype ==
true) {
41 public function getScheme($scheme, $config, $context)
48 $allowed_schemes = $config->get(
'URI.AllowedSchemes');
49 if (!$config->get(
'URI.OverrideAllowedSchemes') &&
50 !isset($allowed_schemes[$scheme])
55 if (isset($this->schemes[$scheme])) {
56 return $this->schemes[$scheme];
58 if (!isset($allowed_schemes[$scheme])) {
62 $class =
'HTMLPurifier_URIScheme_' . $scheme;
63 if (!class_exists($class)) {
66 $this->schemes[$scheme] =
new $class();
67 return $this->schemes[$scheme];
75 public function register($scheme, $scheme_obj)
77 $this->schemes[$scheme] = $scheme_obj;