@@ -498,14 +498,18 @@ public function getNode(): Folder {
498498 }
499499
500500 public function getNodeForPath ($ path ) {
501+ return $ this ->getNodeForPathInternal ($ path );
502+ }
503+
504+ private function getNodeForPathInternal ($ path , bool $ includeChildren = true ) {
501505 $ nodeIsRoot = $ this ->path === '/ ' ;
502506 $ path = ltrim ($ path , '/ ' );
503507 $ fullPath = $ nodeIsRoot ? $ this ->path . $ path : $ this ->path . '/ ' . $ path ;
504508
505509 try {
506510 [$ destinationDir , $ destinationName ] = \Sabre \Uri \split ($ fullPath );
507511 $ this ->fileView ->verifyPath ($ destinationDir , $ destinationName , true );
508- $ info = $ this ->fileView ->getFileInfo ($ fullPath );
512+ $ info = $ this ->fileView ->getFileInfo ($ fullPath, $ includeChildren );
509513 } catch (StorageNotAvailableException $ e ) {
510514 throw new \Sabre \DAV \Exception \ServiceUnavailable ($ e ->getMessage (), 0 , $ e );
511515 } catch (InvalidPathException $ ex ) {
@@ -540,8 +544,9 @@ public function getNodeForPath($path) {
540544 $ this ->tree ?->cacheNode($ node );
541545
542546 if ($ destinationDir !== '' ) {
543- // recurse upwards until the root (for backwards²-compatibility)
544- $ this ->getNodeForPath ($ destinationDir );
547+ // recurse upwards until the root (for backwards-compatibility)
548+ // no need to get child information
549+ $ this ->getNodeForPathInternal ($ destinationDir , false );
545550 }
546551
547552 return $ node ;
0 commit comments