cvs: phpweb / search.php
| From: | Jim Winstead | Date: | Fri, 21 Sep 2001 01:59:24 +0000 |
| Subject: | cvs: phpweb / search.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-6514@lists.php.net to get a copy of this message | ||
jimw Thu Sep 20 21:59:24 2001 EDT
Modified files:
/phpweb search.php
Log:
remove magic quoting from search params, encode prevsearch before sending as html
Index: phpweb/search.php
diff -u phpweb/search.php:1.21 phpweb/search.php:1.22
--- phpweb/search.php:1.21 Wed Sep 19 18:52:01 2001
+++ phpweb/search.php Thu Sep 20 21:59:24 2001
@@ -7,11 +7,15 @@
mirror (or emulate it on your own website).
*/
-if (isset($pattern) && ($pattern)) {
+/* we don't want magic slashes in pattern or prevsearch */
+if (isset($pattern) && get_magic_quotes_gpc())
+ $pattern = stripslashes($pattern);
+if (isset($prevsearch) && get_magic_quotes_gpc())
+ $prevsearch = stripslashes($prevsearch);
+
+if ($pattern) {
setcookie("prevsearch",$pattern,0,"",".php.net");
-}
-if (isset($pattern) && ($pattern)) {
if ($show=="quickref") {
header("Location: manual-lookup.php?pattern=".urlencode($pattern));
exit;
@@ -43,7 +47,7 @@
header("Location: $location?$query");
exit;
} else if ($show=="bugdb") {
- $location = "http://www.php.net/bugs.php";
+ $location = "http://bugs.php.net/";
$query =
"cmd=Display+Bugs&status=All&bug_type=Any&search_for=".urlencode($pattern);
header("Location: $location?$query");
exit;
@@ -102,7 +106,7 @@
<td align="right">
Search for:<br></td>
<td>
-<input type="text" name="pattern" value="<?php echo
$prevsearch;?>" size="30">
+<input type="text" name="pattern" value="<?php echo
htmlspecialchars($prevsearch);?>" size="30">
<input type="submit" value=" Search "><br>
</td></tr>
<tr valign="top">