File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
files_external/lib/Lib/Storage Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 4141use OCP \Files \FileInfo ;
4242use OCP \Files \ForbiddenException ;
4343use OCP \Files \InvalidPathException ;
44+ use OCP \Files \NotPermittedException ;
4445use OCP \Files \StorageNotAvailableException ;
4546use OCP \Lock \ILockingProvider ;
4647use OCP \Lock \LockedException ;
@@ -343,6 +344,8 @@ public function getQuotaInfo() {
343344 return [0 , 0 ];
344345 } catch (\OCP \Files \StorageNotAvailableException $ e ) {
345346 return [0 , 0 ];
347+ } catch (NotPermittedException $ e ) {
348+ return [0 , 0 ];
346349 }
347350 }
348351
Original file line number Diff line number Diff line change 6161use OCP \Files \EntityTooLargeException ;
6262use OCP \Files \Notify \IChange ;
6363use OCP \Files \Notify \IRenameChange ;
64+ use OCP \Files \NotPermittedException ;
6465use OCP \Files \Storage \INotifyStorage ;
6566use OCP \Files \StorageAuthException ;
6667use OCP \Files \StorageNotAvailableException ;
@@ -235,7 +236,11 @@ private function getACL(IFileInfo $file): ?ACL {
235236 protected function getFolderContents ($ path ): iterable {
236237 try {
237238 $ path = ltrim ($ this ->buildPath ($ path ), '/ ' );
238- $ files = $ this ->share ->dir ($ path );
239+ try {
240+ $ files = $ this ->share ->dir ($ path );
241+ } catch (ForbiddenException $ e ) {
242+ throw new NotPermittedException ();
243+ }
239244 foreach ($ files as $ file ) {
240245 $ this ->statCache [$ path . '/ ' . $ file ->getName ()] = $ file ;
241246 }
@@ -595,7 +600,7 @@ public function opendir($path) {
595600 $ files = $ this ->getFolderContents ($ path );
596601 } catch (NotFoundException $ e ) {
597602 return false ;
598- } catch (ForbiddenException $ e ) {
603+ } catch (NotPermittedException $ e ) {
599604 return false ;
600605 }
601606 $ names = array_map (function ($ info ) {
You can’t perform that action at this time.
0 commit comments