From nobody Wed Jan 04 18:29:00 2023 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NnJ5n1LSsz2rB1b for ; Wed, 4 Jan 2023 18:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NnJ5n0tbpz4FpN; Wed, 4 Jan 2023 18:29:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672856941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xpw2z7i6c+jTaGX6RSwXGUyCV9RP4ns1NtLiChKNzW0=; b=R0LH+zBUoTkKd4hvto9ay+FdFux4HiWheO4y3XXu/2kUOIS6zTyB8cCfh2/VI3mXhhHq3r z++egMLPc/t35KMH6eecV1KVfiohM9VTkn0J6Y7WSs+tHtu3vlXOJvtEUsHS6nI/iMIJsN wYBBDaKsMsGmDawrqWeIIri98VrcYbe7lPmhQouEwsqwVH5AJRlNs/YIWAbfhZarPuNyZA pi9xnpIulF8uFlLfG65RtrAnk5mVT2nLWMyjAOXTW353ebQ7cADNPfUsVY2CerlAQi7c5q aL8IiRv8W4kxUiZZDBv4KARKfHnIxyX9e0/JKWSWXZiO8IBHNxx8ej4WB+k01Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672856941; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xpw2z7i6c+jTaGX6RSwXGUyCV9RP4ns1NtLiChKNzW0=; b=mxZUF3DTz7w+kabvJq4OiaQsCS7LswOGcrjC7Vik3sHxKPyrCrG1FaG/xFkq4cFmDm+M1W E9FCa4AUzgeDBcQ5mpOUWcnwhy4S4PELn4v9cx/nnJ3Y7WjzFmAbdg59sQ/MMg7ZPrbEVx G+Pb1brVVzRgWo8Ct7SZCMnp5u7ANuJlrytmcVzkjGZ0amz/P8llD1U/PKSTmQ/XqI5vwq EdSAGKkvOVZSyo1XU3utamwoC20yt5ge68Fmsn6d3ZqsnbU++6SSgjbUWXhT0iLqWNlrMt K7EtjntzrDH7nTbE3E9b1K/rstHDJ2sGO5F8Rnvsakmx8hxVS/8r7kepu2EoWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672856941; a=rsa-sha256; cv=none; b=X1T9xGR4qZz+BOqqt17ccNLAkWAzlbrz+k/SYjOUy6on57jo+5+QK9OQbVyHrWZ1oXH+Jp TUjQOgMEaF4CkpLkldx3aNyhQdlJz7QaeSnyo2GJUJesPKRaJKo7LS/dc7Ct+ou4lIeDYU YA9LK63BtSp60OpPlw6zic1OR0f72XRBpfqR08EfGWHLEUW+wlXMYUzZMtZzBdRdsnX66F PLjK7BvrqKcM4/H6rU+HEv/1hYbDwe1R7KvjpxS0qRv8fH0bMecRjYjPaNZaN9xU5prX2D JKsdeOOrQ+TENqCWThajGwJt73fASRgEzTcebw9vGwRM1dxjyfvDCobVm8lo7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NnJ5m73VyzL2P; Wed, 4 Jan 2023 18:29:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 304IT075017087; Wed, 4 Jan 2023 18:29:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 304IT0QW017086; Wed, 4 Jan 2023 18:29:00 GMT (envelope-from git) Date: Wed, 4 Jan 2023 18:29:00 GMT Message-Id: <202301041829.304IT0QW017086@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Wolfram Schneider Subject: git: 5ab82f33cb - main - Firefox opensearch autocomplete workarounds List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ab82f33cb9e28f730881431252cae8a4ab4a2bd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/doc/commit/?id=5ab82f33cb9e28f730881431252cae8a4ab4a2bd commit 5ab82f33cb9e28f730881431252cae8a4ab4a2bd Author: Wolfram Schneider AuthorDate: 2023-01-04 17:34:40 +0000 Commit: Wolfram Schneider CommitDate: 2023-01-04 17:34:40 +0000 Firefox opensearch autocomplete workarounds --- website/content/en/cgi/ports.cgi | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/website/content/en/cgi/ports.cgi b/website/content/en/cgi/ports.cgi index e163f4a23f..0e6d425ee6 100755 --- a/website/content/en/cgi/ports.cgi +++ b/website/content/en/cgi/ports.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -T # -# Copyright (c) 1996-2022 Wolfram Schneider +# Copyright (c) 1996-2023 Wolfram Schneider # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -496,7 +496,7 @@ sub footer { print qq{ Powered by FreeBSD -© 1996-2022 by Wolfram Schneider. All rights reserved.
+© 1996-2023 by Wolfram Schneider. All rights reserved.
}; #print q{$FreeBSD$} . "
\n"; @@ -507,6 +507,24 @@ sub footer { print qq{
\n

\n}; } +sub check_query { + my ($query, $sourceid) = @_; + + $query =~ s/"/ /g; + $query =~ s/^\s+//; + $query =~ s/\s+$//; + + # XXX: Firefox opensearch autocomplete workarounds + if ($sourceid eq 'opensearch') { + # remove space before a dot + $query =~ s/ \././g; + # remove space between double colon + $query =~ s/: :/::/g; + } + + return $query; +} + sub check_input { if ($query) { $stype = "all" if !$stype; @@ -571,6 +589,7 @@ $section = $form{'sektion'}; $section = 'all' if ( !$section ); $query = $form{'query'}; $stype = $form{'stype'}; +$sourceid = $form{'sourceid'} // ""; $script_name = &env('SCRIPT_NAME'); if ( $path_info eq "/source" ) { @@ -602,9 +621,7 @@ if ( !$query && $query_string =~ /^([^=&]+)$/ ) { # automatically read collections, need only 0.2 sec on a pentium @sec = &readcoll; -$query =~ s/"/ /g; -$query =~ s/^\s+//; -$query =~ s/\s+$//; +$query = &check_query($query, $sourceid); &forms; if ( $query_string eq "" || !$query ) {