mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 14:16:32 +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:
@@ -5,10 +5,13 @@ require_once 'HTMLPurifier/URIScheme.php';
|
||||
require_once 'HTMLPurifier/URIScheme/http.php';
|
||||
require_once 'HTMLPurifier/URIScheme/ftp.php';
|
||||
require_once 'HTMLPurifier/URIScheme/https.php';
|
||||
//require_once 'HTMLPurifier/URIScheme/mailto.php';
|
||||
require_once 'HTMLPurifier/URIScheme/mailto.php';
|
||||
require_once 'HTMLPurifier/URIScheme/news.php';
|
||||
require_once 'HTMLPurifier/URIScheme/nntp.php';
|
||||
|
||||
// WARNING: All the URI schemes are far to relaxed, we need to tighten
|
||||
// the checks.
|
||||
|
||||
class HTMLPurifier_URISchemeTest extends UnitTestCase
|
||||
{
|
||||
|
||||
@@ -104,8 +107,7 @@ class HTMLPurifier_URISchemeTest extends UnitTestCase
|
||||
);
|
||||
}
|
||||
|
||||
// mailto currently isn't implemented yet
|
||||
function non_test_mailto() {
|
||||
function test_mailto() {
|
||||
|
||||
$scheme = new HTMLPurifier_URIScheme_mailto();
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
@@ -116,6 +118,12 @@ class HTMLPurifier_URISchemeTest extends UnitTestCase
|
||||
array(null, null, null, 'bob@example.com', null)
|
||||
);
|
||||
|
||||
$this->assertIdentical(
|
||||
$scheme->validateComponents(
|
||||
'user', 'example.com', 80, 'bob@example.com', 'subject=Foo!', $config),
|
||||
array(null, null, null, 'bob@example.com', 'subject=Foo!')
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user