From 46c4fb40c9d9193359ab7cfb985135be035f5843 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sun, 21 Jan 2007 03:47:38 +0000 Subject: [PATCH] Remove any additional trailing slashes when subpaging is enabled --- includes/Parser.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index 17ee937c58..587c6374df 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1922,9 +1922,9 @@ class Parser # Look at the first character if( $target != '' && $target{0} == '/' ) { # / at end means we don't want the slash to be shown - if( substr( $target, -1, 1 ) == '/' ) { - $target = substr( $target, 1, -1 ); - $noslash = $target; + $trailingSlashes = preg_match_all( '%(/+)$%', $target, $m ); + if( $trailingSlashes ) { + $noslash = $target = substr( $target, 1, -strlen($m[0][0]) ); } else { $noslash = substr( $target, 1 ); } -- 2.20.1