From 72a48ca35eb99be1b3fae8bd9843dabcd7ff1a11 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 12:01:18 +0200
Subject: [PATCH] fix download of single publically shared files.

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

diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 2d6437d819f..6aab650aa7f 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -82,7 +82,12 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
 			}
 			// Download the file
 			if (isset($_GET['download'])) {
-				OC_Files::get($path, '', $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+				if (isset($_GET['dir'])) {
+					OC_Files::get($path, '', $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+				} else {
+					OC_Files::get("", $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+				}
+				
 			} else {
 				OCP\Util::addStyle('files_sharing', 'public');
 				OCP\Util::addScript('files_sharing', 'public');
-- 
GitLab