Merge pull request #59 from cypherbits/link_privacy
Add chat link privacy with noreferrer and noopener
This commit is contained in:
4
chat.php
4
chat.php
@ -3030,9 +3030,9 @@ function create_hotlinks($message){
|
|||||||
$message=preg_replace_callback('/<<([^<>]+)>>/u',
|
$message=preg_replace_callback('/<<([^<>]+)>>/u',
|
||||||
function ($matches){
|
function ($matches){
|
||||||
if(strpos($matches[1], '://')===false){
|
if(strpos($matches[1], '://')===false){
|
||||||
return "<a href=\"http://$matches[1]\" target=\"_blank\">$matches[1]</a>";
|
return "<a href=\"http://$matches[1]\" target=\"_blank\" rel=\"noreferrer noopener\">$matches[1]</a>";
|
||||||
}else{
|
}else{
|
||||||
return "<a href=\"$matches[1]\" target=\"_blank\">$matches[1]</a>";
|
return "<a href=\"$matches[1]\" target=\"_blank\" rel=\"noreferrer noopener\">$matches[1]</a>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
, $message);
|
, $message);
|
||||||
|
Reference in New Issue
Block a user