mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-31 19:30:21 +02:00
Add AutoFormat.RemoveEmpty.Predicate, fixes #35.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
This commit is contained in:
@@ -91,6 +91,25 @@ class HTMLPurifier_Injector_RemoveEmptyTest extends HTMLPurifier_InjectorHarness
|
||||
$this->assertResult('<b> </b>', "<b>\xC2\xA0</b>");
|
||||
}
|
||||
|
||||
public function testRemoveIframe()
|
||||
{
|
||||
$this->config->set('HTML.SafeIframe', true);
|
||||
$this->assertResult('<iframe></iframe>', '');
|
||||
}
|
||||
|
||||
public function testNoRemoveIframe()
|
||||
{
|
||||
$this->config->set('HTML.SafeIframe', true);
|
||||
$this->assertResult('<iframe src="http://google.com"></iframe>', '');
|
||||
}
|
||||
|
||||
public function testRemoveDisallowedIframe()
|
||||
{
|
||||
$this->config->set('HTML.SafeIframe', true);
|
||||
$this->config->set('URI.SafeIframeRegexp', '%^http://www.youtube.com/embed/%');
|
||||
$this->assertResult('<iframe src="http://google.com"></iframe>', '');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
||||
|
Reference in New Issue
Block a user