cvs: phpweb / search.php searchbar.php

From: Date: Sun, 02 Mar 2003 16:22:14 +0000
Subject: cvs: phpweb / search.php searchbar.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-16000@lists.php.net to get a copy of this message
goba Sun Mar 2 11:22:14 2003 EDT Modified files: /phpweb search.php searchbar.php Log: Less code is needed to handle language now in search.php as it is in langchooser.inc. Also provide better default in case $show is not set Only print out the $LANG parameter in the searchbar, when explicit... Index: phpweb/search.php diff -u phpweb/search.php:1.66 phpweb/search.php:1.67 --- phpweb/search.php:1.66 Sat Feb 1 17:39:58 2003 +++ phpweb/search.php Sun Mar 2 11:22:14 2003 @@ -49,8 +49,6 @@ // (also preserves $lang if provided in POST/GET) if (!isset($lang) && isset($LANG)) { $lang = $LANG; -} elseif (!isset($lang)) { - $lang = default_language(); } // Only allow alphabetical chars in lang (security) @@ -59,7 +57,7 @@ } // Only allow alphabetical chars in show (security) -if (isset($show) && !preg_match("!^\\w+$!", $show)) { +if (!isset($show) || !preg_match("!^\\w+$!", $show)) { $show = "wholesite"; } Index: phpweb/searchbar.php diff -u phpweb/searchbar.php:1.12 phpweb/searchbar.php:1.13 --- phpweb/searchbar.php:1.12 Fri Jan 24 15:09:57 2003 +++ phpweb/searchbar.php Sun Mar 2 11:22:14 2003 @@ -42,7 +42,11 @@ <td colspan="2"> <div class="indented"> <form method="post" action="/search.php" target="<?php echo $target ?>" name="sform"> - <input type="hidden" name="lang" value="<?php if(empty($LANG)) echo htmlspecialchars(default_language()); else echo htmlspecialchars($LANG); ?>"> +<?php + if (isset($EXPL_LANG)) { + echo ' <input type="hidden" name="lang" value="'. $EXPL_LANG . '" />'; + } +?> Search for<br /> <input type="text" name="pattern" value="" style="width: 95%"/><br /> in the<br />

« previous php.mirrors (#16000) next »