From c99f62891a53097115c07f6e860b4dfdf4d70600 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= <schiessle@owncloud.com>
Date: Fri, 5 Oct 2012 15:06:59 +0200
Subject: [PATCH] breadcrumbs fixed for public share view

---
 apps/files_sharing/public.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 13a328ff74c..67b2dca8c9e 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -122,12 +122,16 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
 					// Make breadcrumb
 					$breadcrumb = array();
 					$pathtohere = '';
+					$count = 1;
 					foreach (explode('/', $dir) as $i) {
 						if ($i != '') {
 							if ($i != $baseDir) {
 								$pathtohere .= '/'.$i;
+							}						
+							if ( strlen($pathtohere) <  strlen($_GET['dir'])) {
+								continue;
 							}
-							$breadcrumb[] = array('dir' => $pathtohere, 'name' => $i);
+							$breadcrumb[] = array('dir' => str_replace($_GET['dir'], "", $pathtohere, $count), 'name' => $i);
 						}
 					}
 					$list = new OCP\Template('files', 'part.list', '');
-- 
GitLab