1
0
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:
Edward Z. Yang
2006-08-12 17:06:14 +00:00
parent 10ea44932a
commit 6c3d364213
5 changed files with 35 additions and 10 deletions

View File

@@ -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);
}

View File

@@ -52,6 +52,10 @@ class HTMLPurifier_URISchemeRegistry
return $this->schemes[$scheme];
}
function register($scheme, &$scheme_obj) {
$this->schemes[$scheme] =& $scheme_obj;
}
}
?>
?>