]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge pull request #21960 from owncloud/share2_ocs_fix_passing_empty_strings
authorThomas Müller <thomas.mueller@tmit.eu>
Thu, 28 Jan 2016 10:58:35 +0000 (11:58 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Thu, 28 Jan 2016 10:58:35 +0000 (11:58 +0100)
Share2 ocs fix passing empty strings

1  2 
apps/files_sharing/api/share20ocs.php
apps/files_sharing/tests/api/share20ocstest.php

index 8d481d817ea5bdede7eec36ac478a76f5360692c,1d84aefa764615af18f72f0c357105b48ddde7dc..a3276c5867a2f59a8da91c0a4ad66a87765eeddf
@@@ -491,11 -537,19 +535,19 @@@ class Share20OCS 
                return new \OC_OCS_Result($this->formatShare($share));
        }
  
+       public function validatePermissions($permissions) {
+               if ($permissions < 0 || $permissions > \OCP\Constants::PERMISSION_ALL) {
+                       return false;
+               }
+       }
        /**
 -       * @param IShare $share
 +       * @param \OCP\Share\IShare $share
         * @return bool
         */
 -      protected function canAccessShare(IShare $share) {
 +      protected function canAccessShare(\OCP\Share\IShare $share) {
                // A file with permissions 0 can't be accessed by us. So Don't show it
                if ($share->getPermissions() === 0) {
                        return false;