From 589c3338302181eb780f01d65a0d82749f7f2107 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Fri, 4 Nov 2005 11:46:46 +0000 Subject: [PATCH] * 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. --- docs/NEWS | 5 +++++ include/functions_permalinks.inc.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/NEWS b/docs/NEWS index e65a72d..ebb8d56 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,11 @@ 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) diff --git a/include/functions_permalinks.inc.php b/include/functions_permalinks.inc.php index 8c65e2b..d408ee4 100644 --- a/include/functions_permalinks.inc.php +++ b/include/functions_permalinks.inc.php @@ -518,7 +518,7 @@ function serendipity_currentURL() { if (!empty($uri['query'])) { $qst = '&' . str_replace('&', '&', $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( -- 2.39.5