1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +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

@@ -195,11 +195,11 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness
$this->scheme =& new HTMLPurifier_URISchemeMock($this);
// here are the schemes we will support with overloaded mocks
$registry->setReturnReference('getScheme', $this->scheme, array('http'));
$registry->setReturnReference('getScheme', $this->scheme, array('mailto'));
$registry->setReturnReference('getScheme', $this->scheme, array('http', $this->config));
$registry->setReturnReference('getScheme', $this->scheme, array('mailto', $this->config));
// default return value is false (meaning no scheme defined: reject)
$registry->setReturnValue('getScheme', false, array('*'));
$registry->setReturnValue('getScheme', false, array('*', $this->config));
if ($this->components === false) {
$this->scheme->expectNever('validateComponents');