]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix url generated for public shared files
authorTom Needham <needham.thomas@gmail.com>
Sun, 28 Oct 2012 15:03:21 +0000 (15:03 +0000)
committerTom Needham <needham.thomas@gmail.com>
Sun, 28 Oct 2012 15:03:21 +0000 (15:03 +0000)
apps/files_sharing/lib/api.php

index b1dc0d9e68e78734e390c4a208e38ae201fb084d..b450b359a4b5f26afe3ee6673f4e97c7cff32582 100644 (file)
@@ -14,7 +14,7 @@ class OC_Sharing_API {
                        'remote' => OCP\Share::SHARE_TYPE_USER,
                        );
                $type = $typemap[$parameters['type']];
-               $shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : '';
+               $shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null;
                $permissionstring = isset($_POST['permissions']) ? $_POST['permissions'] : '';
                $permissionmap = array(
                        'C' => OCP\Share::PERMISSION_CREATE,
@@ -37,7 +37,7 @@ class OC_Sharing_API {
                }
                switch($type){
                        case OCP\Share::SHARE_TYPE_LINK:
-                               return array('url' => OC_Helper::linkToPublic('files') . '&file=' . OC_User::getUser() . '/files' . $path);
+                               return array('url' => OC_Helper::linkToPublic('files') . '&file=/' . OC_User::getUser() . '/files' . $path);
                        break;
                }