diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 04dcbd680e3d5de8e4b0fae3d05131383fd8bf5c..4b536097414683bec86f6895c9516622e037ab19 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -148,7 +148,7 @@ if (isset($path)) {
 			// Make breadcrumb
 			$breadcrumb = array();
 			$pathtohere = '';
-			foreach (explode('/', $dir) as $i) {
+			foreach (explode('/', $getPath) as $i) {
 				if ($i != '') {
 					$pathtohere .= '/' . $i;
 					$breadcrumb[] = array('dir' => $pathtohere, 'name' => $i);