ports-autocomplete.cgi: use the OpenSearch suggestions content type
Send application/x-suggestions+json instead of text/javascript;
the response is JSON, not JavaScript.
ports-autocomplete.cgi: no default query
Without a query parameter the script returned suggestions for
the test query "bbbike". Return an empty list instead.
ports-autocomplete.cgi: apply Firefox workaround after sorting
The "::" and "." workaround changed the data before the prefix
sort, so queries containing "::" or "." never matched as a
prefix. Apply it to the final list instead.
ports-autocomplete.cgi: fix prefix sort for case-sensitive search
With icase=0 the data was still lowercased before the prefix
check, so queries with uppercase letters never matched as a
prefix.
ports-autocomplete.cgi: harden input handling
Limit the query to 64 characters, ignore the debug parameter
for web requests, and remove IFS, CDPATH, ENV and BASH_ENV from
the environment before running grep.
ports.cgi: don't read INDEX for invalid package queries
A pkg search with a query that is not a valid category/port
path fell through to the INDEX search, which never matches
stype=pkg. Skip it and show "nothing found" directly.
ports.cgi: sanitize query in log message
A newline in the query could inject fake lines into the error
log. Replace non-printable characters before logging.
cgi-style-responsive.pl: remove canonical link and og:url
Every CGI page declared https://www.freebsd.org/ as its canonical
URL, telling search engines it is a duplicate of the home page.
Remove both tags so each page uses its own URL.
Note: these lines were copied from the main website template;
don't re-add them when syncing.
ports.cgi: use div instead of span around paragraphs
A span is an inline element and must not contain block elements
such as p. Use a div for the "nothing found" message and the
noscript warning.