mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-30 19:00:10 +02:00
Augment URISchemeRegistry with the ability to overload/register your own schemes.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@215 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -46,10 +46,10 @@ class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef
|
||||
// no need to validate the scheme's fmt since we do that when we
|
||||
// retrieve the specific scheme object from the registry
|
||||
$scheme = ctype_lower($scheme) ? $scheme : strtolower($scheme);
|
||||
$scheme_obj =& $registry->getScheme($scheme);
|
||||
$scheme_obj =& $registry->getScheme($scheme, $config);
|
||||
if (!$scheme_obj) return ''; // invalid scheme, clean it out
|
||||
} else {
|
||||
$scheme_obj =& $registry->getScheme($config->get('URI', 'DefaultScheme'));
|
||||
$scheme_obj =& $registry->getScheme($config->get('URI', 'DefaultScheme'), $config);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -52,6 +52,10 @@ class HTMLPurifier_URISchemeRegistry
|
||||
return $this->schemes[$scheme];
|
||||
}
|
||||
|
||||
function register($scheme, &$scheme_obj) {
|
||||
$this->schemes[$scheme] =& $scheme_obj;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user