]> git.mjollnir.org Git - s9y.git/commitdiff
* Fix a bug in the serendipity_currentURL function when Serendipity is installed...
authorgarvinhicking <garvinhicking>
Fri, 4 Nov 2005 11:46:56 +0000 (11:46 +0000)
committergarvinhicking <garvinhicking>
Fri, 4 Nov 2005 11:46:56 +0000 (11:46 +0000)
docs/NEWS
include/functions_permalinks.inc.php

index b5055eaf1f175502fb311e1a5e532d1d879acae7..a8277a2b76d64a1cfda082e624f8ea0bcf422760 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -10,6 +10,11 @@ Version 1.0 ()
 Version 0.9.1 ()
 ------------------------------------------------------------------------
 
+    * Fix a bug in the serendipity_currentURL function when Serendipity 
+      is installed in your HTTP root. This bug only effects the plugins karma, 
+      entrysplit and multilingual on these installations. 
+      Thanks to Richard Davey for spotting this! (garvinhicking)
+
     * Fix showing preview image of hotlinked images. Thanks to Thomas
       and RobA from the forums! (garvinhicking)
 
index 8c65e2b5eae92aea72a6214808b6ad9ea0de42ba..d408ee4273f13ea82bfec9d8510aa31c4edf499b 100644 (file)
@@ -518,7 +518,7 @@ function serendipity_currentURL() {
     if (!empty($uri['query'])) {
         $qst = '&amp;' . str_replace('&', '&amp;', $uri['query']);
     }
-    $uri['path'] = str_replace($serendipity['serendipityHTTPPath'], '', $uri['path']);
+    $uri['path'] = preg_replace('@^' . preg_quote($serendipity['serendipityHTTPPath']) . '@i', '', $uri['path']);
     $url = $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?' . $uri['path'] . $qst;
     $url = str_replace(
         array(