diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 2862ad510ee01573b6b360b024434c9da638629c..04dcbd680e3d5de8e4b0fae3d05131383fd8bf5c 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -92,7 +92,7 @@ if (isset($path)) {
 		}
 	}
 	$basePath = $path;
-	if (isset($_GET['path']) && \OC\Files\Filesystem::isReadable($_GET['path'])) {
+	if (isset($_GET['path']) && \OC\Files\Filesystem::isReadable($basePath . $_GET['path'])) {
 		$getPath = \OC\Files\Filesystem::normalizePath($_GET['path']);
 		$path .= $getPath;
 	} else {