1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 19:30:21 +02:00

feat: Add option for safe iframe hosts using array lookup (#423)

Co-authored-by: Edward Z. Yang <ezyang@meta.com>
This commit is contained in:
Eli Barbosa
2024-11-09 19:02:09 -08:00
committed by GitHub
parent f16ace76cd
commit b5cbf0cc3d
7 changed files with 40 additions and 6 deletions

View File

@@ -115,6 +115,12 @@ class HTMLPurifier_Injector_RemoveEmptyTest extends HTMLPurifier_InjectorHarness
$this->assertResult('<iframe src="http://google.com"></iframe>', '');
}
public function testRemoveDisallowedIframeDeniedByHostsList()
{
$this->config->set('HTML.SafeIframe', true);
$this->config->set('URI.SafeIframeHosts', ['www.youtube.com']);
$this->assertResult('<iframe src="http://maps.google.com"></iframe>', '');
}
}
// vim: et sw=4 sts=4