Skip to content

Commit

Permalink
use noreferer and noopener for anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
davidovski committed May 16, 2024
1 parent c690490 commit c67bfbb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion engines/invidious/video.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function print_results($results, $opts) {
$thumbnail = preg_replace('/(?:https?:\/\/)?(?:www\.)?youtube\.com\/watch\?v=([^\s]+)/', 'https://i.ytimg.com/vi/$1/maxresdefault.jpg', $url) ?? '';

echo "<div class=\"text-result-wrapper\">";
echo "<a href=\"$url\">";
echo "<a rel=\"noreferer noopener\" href=\"$url\">";
echo "$base_url";
echo "<h2>$title</h2>";
echo "<img class=\"video-img\" src=\"image_proxy.php?url=$thumbnail\">";
Expand Down
2 changes: 1 addition & 1 deletion engines/qwant/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function print_results($results, $opts) {
$url = $result["url"];
$url = check_for_privacy_frontend($url, $opts);

echo "<a title=\"$alt\" href=\"$url\" target=\"_blank\">";
echo "<a title=\"$alt\" href=\"$url\" rel=\"noreferer noopener\" target=\"_blank\">";
echo "<img src=\"image_proxy.php?url=$thumbnail\">";
echo "</a>";
}
Expand Down
4 changes: 2 additions & 2 deletions engines/text/text.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static function print_results($results, $opts) {
echo $response;
if ($source) {
$source = check_for_privacy_frontend($source, $opts);
echo "<a href=\"$source\" target=\"_blank\">$source</a>";
echo "<a href=\"$source\" rel=\"noreferer noopener\" target=\"_blank\">$source</a>";
}
echo "</p>";
}
Expand All @@ -175,7 +175,7 @@ public static function print_results($results, $opts) {
$description = $result["description"];

echo "<div class=\"text-result-wrapper\">";
echo "<a href=\"$url\">";
echo "<a rel=\"noreferer noopener\" href=\"$url\">";
echo "$base_url";
echo "<h2>$title</h2>";
echo "</a>";
Expand Down

0 comments on commit c67bfbb

Please sign in to comment.