mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-10 17:26:25 +02:00
Refactor HTML.Noopener to HTML.TargetNoopener so that it behaves like HTML.TargetNoreferrer and is active by default if a target is set
This commit is contained in:
committed by
Edward Z. Yang
parent
c82051c3e1
commit
8e4cacf0a7
@ -13,7 +13,14 @@ class HTMLPurifier_HTMLModule_TargetBlankTest extends HTMLPurifier_HTMLModuleHar
|
||||
{
|
||||
$this->assertResult(
|
||||
'<a href="http://google.com">a</a><a href="/local">b</a><a href="mailto:foo@example.com">c</a>',
|
||||
'<a href="http://google.com" target="_blank" rel="noreferrer">a</a><a href="/local">b</a><a href="mailto:foo@example.com">c</a>'
|
||||
'<a href="http://google.com" target="_blank" rel="noreferrer noopener">a</a><a href="/local">b</a><a href="mailto:foo@example.com">c</a>'
|
||||
);
|
||||
}
|
||||
|
||||
public function testTargetBlankNoDupe() {
|
||||
$this->assertResult(
|
||||
'<a href="http://google.com" target="_blank">a</a>',
|
||||
'<a href="http://google.com" target="_blank" rel="noreferrer noopener">a</a>'
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user