Browse Source

replace language variable

svn path=/trunk/; revision=32351
tags/stw2018
paul 3 years ago
parent
commit
e812e9e41a
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      cgi-bin/search.cgi

+ 3
- 2
cgi-bin/search.cgi View File

@@ -1,7 +1,7 @@
#!/bin/sh

c=/home/www/fsfe.org_htdig/htdig.conf
l="$(printf %s "$QUERY_STRING" |sed -rn '1s;^(.*&)?l=([^&]+)(&.*)?$;\2;p')"
l="$(printf %s "$QUERY_STRING" |sed -rn '1s;^(.*&)?l=([a-z-]+)(&.*)?$;\2;p')"
q="$(printf %s "$QUERY_STRING" |sed -rn '1s;^(.*&)?q=([^&]+)(&.*)?$;\2;p')"

# htdig forces default config file if reading cgi-variabled directly
@@ -18,4 +18,5 @@ printf %s\\n\\n "Content-Type: text/html;charset=utf-8"
| tail -n+3 \
| sed -r 's;&euro\;;\xa4;g' \
| xmllint --html --encode iso-8859-1 - \
| sed -r '2s;charset=iso-8859-1;charset=utf-8;'
| sed -r '2s;charset=iso-8859-1;charset=utf-8;' \
| sed "s;#LANG;${l};"

Loading…
Cancel
Save