cvs: phpweb / search.php
| From: | Gabor Hojtsy | Date: | Wed, 04 Jun 2003 08:40:09 +0000 |
| Subject: | cvs: phpweb / search.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-18489@lists.php.net to get a copy of this message | ||
goba Wed Jun 4 04:40:09 2003 EDT
Modified files:
/phpweb search.php
Log:
Tabs -> spaces on top, and override $lang with
$LANG if $lang was empty or not set, given that
$LANG is always set to some useable language
code
Index: phpweb/search.php
diff -u phpweb/search.php:1.88 phpweb/search.php:1.89
--- phpweb/search.php:1.88 Sat May 24 17:11:40 2003
+++ phpweb/search.php Wed Jun 4 04:40:09 2003
@@ -1,13 +1,13 @@
<?php
-/* $Id: search.php,v 1.88 2003/05/24 21:11:40 alindeman Exp $ */
+/* $Id: search.php,v 1.89 2003/06/04 08:40:09 goba Exp $ */
include_once "prepend.inc";
-/* convert POST -> GET when dumping the user onto a mirror */
+// Convert POST -> GET when dumping the user onto a mirror
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
- $_SERVER['REQUEST_URI'] = "/search.php?show=$show&pattern=" .
- urlencode($pattern) .
- "&base=" . urlencode($MYSITE) . "&lang=$lang";
+ $_SERVER['REQUEST_URI'] = "/search.php?show=$show&pattern=" .
+ urlencode($pattern) .
+ "&base=" . urlencode($MYSITE) . "&lang=$lang";
}
include 'loadavg.inc';
@@ -55,11 +55,9 @@
if (isset($lang)) { $lang = stripslashes($lang); }
}
-// Set language to the preferred one if not set
-// (also preserves $lang if provided in POST/GET)
-if (!isset($lang) && isset($LANG)) {
- $lang = $LANG;
-}
+// Fallack to preferred language, preserving any
+// language provided in the request
+if (empty($lang)) { $lang = $LANG; }
// Only allow alphabetical chars in lang (security)
if (!preg_match("!^\\w+$!", $lang)) {