mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 14:16:32 +02:00
URI.Munge munges https to http URIs.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
@@ -117,6 +117,23 @@ class HTMLPurifier_URIFilter_MungeTest extends HTMLPurifier_URIFilterHarness
|
||||
$this->assertFiltering('http://example.com/foobar');
|
||||
}
|
||||
|
||||
function testMungeIgnoreSameDomainInsecureToSecure() {
|
||||
$this->setMunge('http://example.com/%s');
|
||||
$this->assertFiltering('https://example.com/foobar');
|
||||
}
|
||||
|
||||
function testMungeIgnoreSameDomainSecureToSecure() {
|
||||
$this->config->set('URI.Base', 'https://example.com');
|
||||
$this->setMunge('http://example.com/%s');
|
||||
$this->assertFiltering('https://example.com/foobar');
|
||||
}
|
||||
|
||||
function testMungeSameDomainSecureToInsecure() {
|
||||
$this->config->set('URI.Base', 'https://example.com');
|
||||
$this->setMunge('/%s');
|
||||
$this->assertFiltering('http://example.com/foobar', '/http%3A%2F%2Fexample.com%2Ffoobar');
|
||||
}
|
||||
|
||||
function testMungeIgnoresSourceHost() {
|
||||
$this->config->set('URI.Host', 'foo.example.com');
|
||||
$this->setMunge('http://example.com/%s');
|
||||
|
Reference in New Issue
Block a user