1
0

Fix bad prev/next permalinks when using wrapper.php embedding

This commit is contained in:
Garvin Hicking
2007-04-05 09:33:48 +00:00
parent e44a22cf06
commit 86c65016bc
4 changed files with 24 additions and 1 deletions

View File

@ -753,12 +753,18 @@ function serendipity_currentURL($strict = false) {
*/
function serendipity_getUriArguments($uri, $wildcard = false) {
global $serendipity;
static $indexFile = null;
if ($indexFile === null) {
$_indexFile = explode('.', $serendipity['indexFile']);
$indexFile = $_indexFile[0];
}
/* Explode the path into sections, to later be able to check for arguments and add our own */
preg_match('/^'. preg_quote($serendipity['serendipityHTTPPath'], '/') . '(' . preg_quote($serendipity['indexFile'], '/') . '\?\/)?(' . ($wildcard ? '.+' : '[;,_a-z0-9\-*\/%\+]+') . ')/i', $uri, $_res);
if (strlen($_res[2]) != 0) {
$args = explode('/', $_res[2]);
if ($args[0] == 'index') {
if ($args[0] == $indexFile || $args[0] == $serendipity['indexFile']) {
unset($args[0]);
}
return $args;