commit 8f7fddae3c1d5bd75041d0b776b0858a3eeb4106
parent 69b1d6f0e29372238197613b0c93055e105adcd4
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date: Sat, 6 Jul 2024 15:23:01 +0200
fix: assign default search immediatly and override after bang-search
Diffstat:
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/index.php b/index.php
@@ -26,7 +26,7 @@ if (strlen($query) > 0) {
);
/* Based on given bang, choose a search engine */
- $search = null;
+ $search = $default_search;
foreach (array_keys($searches) as $key) {
if (array_search($bang, $searches[$key]["bangs"]) !== false) {
/* If bang has been found, assign search engine and end the loop */
@@ -35,11 +35,6 @@ if (strlen($query) > 0) {
}
}
- /* Fallback search engine, if bang wasn't found */
- if (is_null($search)) {
- $search = $default_search;
- }
-
/* Strip bang from search term */
$search_term = preg_replace(
'/\![A-Za-z0-9_\-\.]+/',