cvs: phpweb / search.php
| From: | Gabor Hojtsy | Date: | Wed, 23 Apr 2003 20:05:02 +0000 |
| Subject: | cvs: phpweb / search.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-16968@lists.php.net to get a copy of this message | ||
goba Wed Apr 23 16:05:02 2003 EDT
Modified files:
/phpweb search.php
Log:
prev/next links should not be relative to
the originating server
Index: phpweb/search.php
diff -u phpweb/search.php:1.73 phpweb/search.php:1.74
--- phpweb/search.php:1.73 Wed Apr 23 15:56:23 2003
+++ phpweb/search.php Wed Apr 23 16:05:02 2003
@@ -1,5 +1,5 @@
<?php
-/* $Id: search.php,v 1.73 2003/04/23 19:56:23 goba Exp $ */
+/* $Id: search.php,v 1.74 2003/04/23 20:05:02 goba Exp $ */
include_once "prepend.inc";
@@ -241,9 +241,13 @@
if (strpos($matches, "error") > 0) { searchError(); }
// String to carry on the search parameters in prev/next URLs
- $baseurl = $PHP_SELF . "?pattern=" . urlencode($pattern) .
"&show=$show";
+ $baseurl = substr($PHP_SELF, 1) . "?pattern=" . urlencode($pattern) .
"&show=$show";
if (isset($base)) { $baseurl .= "&base=" . urlencode($base); }
- $baseurl = htmlentities($baseurl);
+
+ // We need to preserve the state with a full URL,
+ // as remote searches would otherwise make these links
+ // relative to the originating server
+ $baseurl = $MYSITE . htmlentities($baseurl);
// Print out search results information header
echo "$matches documents match your search for '<b>$htmlpt</b>'
$where:<br /><br />\n";