ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
TargetNoopener.php
Go to the documentation of this file.
1
<?
php
2
3
// must be called POST validation
4
12
class
HTMLPurifier_AttrTransform_TargetNoopener
extends
HTMLPurifier_AttrTransform
13
{
20
public
function
transform
($attr,
$config
,
$context
)
21
{
22
if
(isset($attr[
'rel'
])) {
23
$rels = explode(
' '
, $attr[
'rel'
]);
24
}
else
{
25
$rels = array();
26
}
27
if
(isset($attr[
'target'
]) && !in_array(
'noopener'
, $rels)) {
28
$rels[] =
'noopener'
;
29
}
30
if
(!empty($rels) || isset($attr[
'rel'
])) {
31
$attr[
'rel'
] = implode(
' '
, $rels);
32
}
33
34
return
$attr;
35
}
36
}
37
HTMLPurifier_AttrTransform
Processes an entire attribute array for corrections needing multiple values.
Definition:
AttrTransform.php:17
$context
$context
Definition:
webdav.php:25
$config
$config
Definition:
bootstrap.php:15
HTMLPurifier_AttrTransform_TargetNoopener\transform
transform($attr, $config, $context)
Definition:
TargetNoopener.php:20
php
HTMLPurifier_AttrTransform_TargetNoopener
Adds rel="noopener" to any links which target a different window than the current one...
Definition:
TargetNoopener.php:12
libs
composer
vendor
ezyang
htmlpurifier
library
HTMLPurifier
AttrTransform
TargetNoopener.php
Generated on Thu Jan 16 2025 19:01:38 for ILIAS by
1.8.13 (using
Doxyfile
)