1
0
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:
Edward Z. Yang
2014-08-31 11:16:30 +01:00
parent b8704535a3
commit 39d3df1fd7
6 changed files with 53 additions and 5 deletions

View File

@@ -91,6 +91,25 @@ class HTMLPurifier_Injector_RemoveEmptyTest extends HTMLPurifier_InjectorHarness
$this->assertResult('<b>&nbsp;</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