git: 645b00391a - main - Firefox opensearch autocomplete workaround

Wolfram Schneider <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by wosch:

URL: https://cgit.FreeBSD.org/doc/commit/?id=645b00391a5374ea843b8066ce9d9f701b991b6f

commit 645b00391a5374ea843b8066ce9d9f701b991b6f
Author:     Wolfram Schneider <[email protected]>
AuthorDate: 2023-01-07 17:17:34 +0000
Commit:     Wolfram Schneider <[email protected]>
CommitDate: 2023-01-07 17:17:34 +0000

    Firefox opensearch autocomplete workaround
---
 website/content/en/cgi/man.cgi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/website/content/en/cgi/man.cgi b/website/content/en/cgi/man.cgi
index 7c5e8bffa9..1d9b116e3c 100755
--- a/website/content/en/cgi/man.cgi
+++ b/website/content/en/cgi/man.cgi
@@ -1193,6 +1193,14 @@ sub do_man {
     $form{'query'} =~ s/"//g;
     $form{'query'} =~ s/=//g;
 
+    # Firefox opensearch autocomplete workaround
+    if ($form{'sourceid'} eq 'opensearch') {
+        # remove space between double colon
+        $form{'query'} =~ s/: :/::/g;
+        # remove space before a dot 
+        $form{'query'} =~ s/ \./\./g;
+    }
+
     $name = $query = $form{'query'};
     $section  = $form{'sektion'};
     $apropos  = $form{'apropos'};
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.