summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartek Przybylski <bart.p.pl@gmail.com>2012-03-29 20:45:21 +0200
committerBartek Przybylski <bart.p.pl@gmail.com>2012-03-29 20:45:21 +0200
commitf74d11c0c3c4a3bcd733499edd63f8e31389a3a3 (patch)
tree21bd16c85811715ca5d7f451dd1661eb763aa088
parent45a3d84748b4e61a562d338df0cc0fd3badcc830 (diff)
downloadnextcloud-server-f74d11c0c3c4a3bcd733499edd63f8e31389a3a3.tar.gz
nextcloud-server-f74d11c0c3c4a3bcd733499edd63f8e31389a3a3.zip
fix gallery sharing when root is not /
-rw-r--r--apps/gallery/ajax/galleryOp.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php
index b0433898cda..1b3ad48f561 100644
--- a/apps/gallery/ajax/galleryOp.php
+++ b/apps/gallery/ajax/galleryOp.php
@@ -127,6 +127,9 @@ function handleGetGallery($path) {
function handleShare($path, $share, $recursive) {
$recursive = $recursive == 'true' ? 1 : 0;
$owner = OC_User::getUser();
+ $root = OC_Preferences::getValue(OC_User::getUser(),'gallery', 'root', '/');
+ $path = utf8_decode(rtrim($root.$path,'/'));
+ if($path == '') $path = '/';
$r = OC_Gallery_Album::find($owner, null, $path);
if ($row = $r->fetchRow()) {
$albumId = $row['album_id'];