parent
8b5bc6950b
commit
b39d9d6746
|
@ -60,10 +60,12 @@ class LinkTransformer extends HTMLPurifier_AttrTransform
|
||||||
$attr['class'] = 'with-thumbnail';
|
$attr['class'] = 'with-thumbnail';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((! isset($attr['target']) || ! in_array($attr['target'], ['_blank', '_self']))
|
if ((! isset($attr['target']) || ! in_array($attr['target'], ['_blank', '_self']))) {
|
||||||
&& ($useIframe || $url->isExternal())
|
if ($useIframe) {
|
||||||
) {
|
$attr['href'] = Url::fromPath('iframe', ['url' => $url])->getAbsoluteUrl();
|
||||||
$attr['href'] = Url::fromPath('iframe', ['url' => $url])->getAbsoluteUrl();
|
} elseif ($url->isExternal()) {
|
||||||
|
$attr['target'] = '_blank';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $attr;
|
return $attr;
|
||||||
|
|
Loading…
Reference in New Issue