Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop adding rel="noreferrer" to external URLs #4857

Merged
merged 1 commit into from Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion wcfsetup/install/files/acp/templates/header.tpl
Expand Up @@ -211,7 +211,6 @@
if (link.classList.contains('externalURL')) {
var rel = (link.rel === '') ? [] : link.rel.split(' ');
if (rel.indexOf('noopener') === -1) rel.push('noopener');
if (rel.indexOf('noreferrer') === -1) rel.push('noreferrer');

link.rel = rel.join(' ');
}
Expand Down
Expand Up @@ -77,7 +77,7 @@ public static function markLinkAsExternal(\DOMElement $element, $isUgc = false)

$rel = 'nofollow';
if (EXTERNAL_LINK_TARGET_BLANK) {
$rel .= ' noopener noreferrer';
$rel .= ' noopener';

$element->setAttribute('target', '_blank');
}
Expand Down
Expand Up @@ -59,7 +59,7 @@ public function execute($tagArgs, TemplateEngine $tplObj)

$rel = 'nofollow';
if (EXTERNAL_LINK_TARGET_BLANK) {
$rel .= ' noopener noreferrer';
$rel .= ' noopener';
$attributes .= ' target="_blank"';
}
if ($isUgc) {
Expand Down
2 changes: 1 addition & 1 deletion wcfsetup/install/files/lib/util/StringUtil.class.php
Expand Up @@ -763,7 +763,7 @@ public static function getAnchorTagAttributes($url, $isUgc = false)
$attributes .= ' class="externalURL"';
$rel = 'nofollow';
if (EXTERNAL_LINK_TARGET_BLANK) {
$rel .= ' noopener noreferrer';
$rel .= ' noopener';
$attributes .= 'target="_blank"';
}
if ($isUgc) {
Expand Down