mirror of
https://github.com/friendica/friendica
synced 2025-04-20 11:10:11 +00:00
Add rel="noopener noreferrer" to all target="_blank" links
See https://mathiasbynens.github.io/rel-noopener/
This commit is contained in:
parent
6a3d40ab46
commit
b100b9600e
22 changed files with 54 additions and 54 deletions
|
@ -943,7 +943,7 @@ class HTML
|
|||
*/
|
||||
public static function toLink($s)
|
||||
{
|
||||
$s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\'\%\$\!\+]*)/", ' <a href="$1" target="_blank">$1</a>', $s);
|
||||
$s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\'\%\$\!\+]*)/", ' <a href="$1" target="_blank" rel="noopener noreferrer">$1</a>', $s);
|
||||
$s = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism", '<$1$2=$3&$4>', $s);
|
||||
return $s;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue