From daaf05530cc439ed35b931ed3b9be3b3b5dc4f62 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 10 Oct 2008 13:05:37 +0000 Subject: [PATCH] BUGFIX Fixed DebugView Breadcrumbs to not include query string as separate link, and don't append an arrow after the last element git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64072 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- dev/DebugView.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dev/DebugView.php b/dev/DebugView.php index 75844d1bd..b96061a0f 100644 --- a/dev/DebugView.php +++ b/dev/DebugView.php @@ -51,17 +51,18 @@ class DebugView { */ public function Breadcrumbs() { $basePath = str_replace(Director::protocolAndHost(), '', Director::absoluteBaseURL()); - $parts = explode('/', str_replace($basePath, '', $_SERVER['REQUEST_URI'])); + $relPath = parse_url(str_replace($basePath, '', $_SERVER['REQUEST_URI']), PHP_URL_PATH); + $parts = explode('/', $relPath); $base = Director::absoluteBaseURL(); - $path = ""; $pathPart = ""; + $pathLinks = array(); foreach($parts as $part) { if ($part != '') { $pathPart .= "$part/"; - $path .= "$part→ "; + $pathLinks[] = "$part"; } } - return $path; + return implode('→ ', $pathLinks); } /**