1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-12 00:54:48 +02:00

Commit a very lenient mailto checker. We'll tighten it later.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@219 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-08-12 19:11:21 +00:00
parent d28bad648a
commit 4193fd018a
5 changed files with 53 additions and 9 deletions

View File

@@ -145,7 +145,7 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness
// test invalid scheme, components shouldn't be passed
$uri[17] = 'javascript:alert("moo");';
$expect_uri[17] = '';
$expect_uri[17] = false;
// relative URIs
@@ -176,7 +176,7 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness
$this->config = isset($config[$i]) ? $config[$i] : null;
$this->context = isset($context[$i]) ? $context[$i] : null;
$this->assertDef($value, $expect_uri[$i], "Test $i: %s");
$this->assertDef($value, $expect_uri[$i], true, "Test $i: %s");
}
@@ -216,6 +216,20 @@ class HTMLPurifier_AttrDef_URITest extends HTMLPurifier_AttrDefHarness
$this->scheme->tally();
}
function testIntegration() {
$this->def = new HTMLPurifier_AttrDef_URI();
$this->config = $this->context = null;
$this->assertDef('http://www.google.com/');
$this->assertDef('javascript:bad_stuff();', false);
$this->assertDef('ftp://www.example.com/');
$this->assertDef('news:rec.alt');
$this->assertDef('nntp://news.example.com/324234');
$this->assertDef('mailto:bob@example.com');
}
}
?>