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

Add rel="noopener noreferrer" to target="_blank" #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add rel="noopener noreferrer" to target="_blank"
rel="noopener noreferrer" should be added to links containing target="_blank" as a precaution against reverse tabnabbing. For more information, please refer to the following article:
https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
  • Loading branch information
auralon committed Mar 12, 2018
commit 06ba4841863cc8d082e00a64c38f0c5c1d816e82
4 changes: 4 additions & 0 deletions fruitlinkit/models/FruitLinkIt_LinkModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public function getHtmlLink($attributes = false)
if( ( !is_array($attributes) || !array_key_exists('title', $attributes) ) && $this->target )
{
$htmlLink .= ' target="'.$this->target.'"';

if ($this->target == '_blank') {
$htmlLink .= ' rel="noopener"';
}
}

// Add Attributes
Expand Down