LibreY

- privacy respecting meta search engine
git clone git://git.acid.vegas/LibreY.git
Log | Files | Refs | Archive | README | LICENSE

commit fa07f21f562684240ec82a7eb034c733173ec289
parent c70436b25790fd8466b5c8548a750b20980ae1b4
Author: davidovski <david@davidovski.xyz>
Date: Wed, 6 Sep 2023 12:23:59 +0100

Move base_url parsing to print results

Diffstat:
Mengines/ahmia/hidden_service.php | 1+
Mengines/invidious/video.php | 3++-
Mengines/text/duckduckgo.php | 1+
Mengines/text/google.php | 1+
Mengines/text/text.php | 2+-

5 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/engines/ahmia/hidden_service.php b/engines/ahmia/hidden_service.php
@@ -23,6 +23,7 @@
                     array (
                         "title" => $title ? htmlspecialchars($title) : "No description provided",
                         "url" =>  htmlspecialchars($url),
+                        // base_url is to be removed in the future, see #47
                         "base_url" => htmlspecialchars(get_base_url($url)),
                         "description" => htmlspecialchars($description)
                     )
diff --git a/engines/invidious/video.php b/engines/invidious/video.php
@@ -23,6 +23,7 @@
                         array (
                             "title" => htmlspecialchars($title),
                             "url" =>  htmlspecialchars($url),
+                            // base_url is to be removed in the future, see #47
                             "base_url" => htmlspecialchars(get_base_url($url)),
                             "uploader" => htmlspecialchars($uploader),
                             "views" => htmlspecialchars($views),
@@ -43,7 +44,7 @@
                     $title = $result["title"];
                     $url = $result["url"];
                     $url = check_for_privacy_frontend($url, $opts);
-                    $base_url = $result["base_url"];
+                    $base_url = get_base_url($url);
                     $uploader = $result["uploader"];
                     $views = $result["views"];
                     $date = $result["date"];
diff --git a/engines/text/duckduckgo.php b/engines/text/duckduckgo.php
@@ -50,6 +50,7 @@
                     array (
                         "title" => htmlspecialchars($title->textContent),
                         "url" =>  htmlspecialchars($url),
+                        // base_url is to be removed in the future, see #47
                         "base_url" => htmlspecialchars(get_base_url($url)),
                         "description" =>  $description == null ?
                                           "No description was provided for this site." :
diff --git a/engines/text/google.php b/engines/text/google.php
@@ -61,6 +61,7 @@
                     array (
                         "title" => htmlspecialchars($title->textContent),
                         "url" =>  htmlspecialchars($url),
+                        // base_url is to be removed in the future, see #47
                         "base_url" => htmlspecialchars(get_base_url($url)),
                         "description" =>  $description == null ?
                                           "No description was provided for this site." :
diff --git a/engines/text/text.php b/engines/text/text.php
@@ -104,7 +104,7 @@
                 $url = $result["url"];
                 $url = check_for_privacy_frontend($url, $opts);
 
-                $base_url = $result["base_url"];
+                $base_url = get_base_url($url);
                 $description = $result["description"];
 
                 echo "<div class=\"text-result-wrapper\">";