LibreY

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

commit aaf111abf72fb20e9896dc25135b61bb6f99d595
parent 4da025948b3f7791aa27840efcea1667f0dcbf05
Author: davidovski <david@davidovski.xyz>
Date: Wed, 30 Aug 2023 16:05:31 +0100

Always do no fallback on fallback requests

Diffstat:
Mengines/librex/fallback.php | 4++--
Mengines/text/text.php | 2+-
Mmisc/search_engine.php | 1-

3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/engines/librex/fallback.php b/engines/librex/fallback.php
@@ -6,9 +6,9 @@
             $this->instance = $instance;
             parent::__construct($opts, $mh);
         }
-
+)
         public function get_request_url() {
-           return $this->instance . "api.php?" . opts_to_params($this->opts);
+           return $this->instance . "api.php?" . opts_to_params($this->opts) . "&nfb=1";
         }
 
         public function parse_results($response) {
diff --git a/engines/text/text.php b/engines/text/text.php
@@ -31,7 +31,7 @@
         }
 
         public function parse_results($response) {
-            if (!$this->engine_request)
+            if (!isset($this->engine_request))
                 return array();
 
             $results = $this->engine_request->get_results();
diff --git a/misc/search_engine.php b/misc/search_engine.php
@@ -97,7 +97,6 @@
         $params .= "p=$opts->page";
         $params .= "&q=$query";
         $params .= "&t=$opts->type";
-        $params .= "&nfb=" . ($opts->do_fallback ? 0 : 1);
         $params .= "&safe=" . ($opts->safe_search ? 1 : 0);
         $params .= "&nf=" . ($opts->disable_frontends ? 1 : 0);
         $params .= "&ns=" . ($opts->disable_special ? 1 : 0);