fix gallery sharing when root is not /

This commit is contained in:
Bartek Przybylski 2012-03-29 20:45:21 +02:00
parent 45a3d84748
commit f74d11c0c3
1 changed files with 3 additions and 0 deletions

View File

@ -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'];