pub / serci

Search the web with !keywords
git clone https://src.jayvii.de/pub/serci.git
Home | Log | Files | Exports | Refs | README | RSS

commit 7b091110fc48c22995969cc81acd4e05beda0e60
parent d9fd6b4244e6d4ee5650d5ad56f8145df27ca08c
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Mon, 25 May 2026 14:31:26 +0200

Revert "fix: ensure opt is properly extracted"

This reverts commit d9fd6b4244e6d4ee5650d5ad56f8145df27ca08c.

Diffstat:
MREADME.md | 2+-
Mindex.php | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md @@ -44,7 +44,7 @@ a `key` or `token` to be used, you can forward this token through serĉi with the `%opt` replacement, e.g.: `!metager:key=abc` for example in private browsing mode. For private mode browser such as Firefox Klar, you could then apply the search URL in the settings like so: -`https://search.example.com/?fallback=metagerweb&q=!metager:key=abc+%s`. +`https://search.example.com/?fallback=metagerweb&q=!metager:key=abc%s`. **BEWARE: the serĉi host is technically able to read this information as well!** ### How can I use serĉi? diff --git a/index.php b/index.php @@ -56,7 +56,7 @@ /* Get options from keyword (syntax: !key:opt)*/ if (preg_match('/\![A-Za-z0-9_\-\.=]+:[A-Za-z0-9_\-\.\/=]+/', $query) === 1) { $keyoption = preg_replace( - '/^.*\![A-Za-z0-9_\-\.=]+:([A-Za-z0-9_\-\.\/=]*).*?$/', + '/^.*?\![A-Za-z0-9_\-\.=]+:([A-Za-z0-9_\-\.\/=]+).*$/', '${1}', $query ); @@ -69,7 +69,7 @@ /* Strip keyword from search term */ $search_term = preg_replace( - '/\![A-Za-z0-9_\-\.=]+:{0,1}[A-Za-z0-9_\-\.\/=]*/g', + '/\![A-Za-z0-9_\-\.=]+:{0,1}[A-Za-z0-9_\-\.\/=]*/', '', $query );