File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ diff --git a/lib/DAV/Tree.php b/lib/DAV/Tree.php
2+ index 65b4583ceb..1483e1bc51 100644
3+ --- a/lib/DAV/Tree.php
4+ +++ b/lib/DAV/Tree.php
5+ @@ -62,9 +62,21 @@ public function getNodeForPath($path)
6+ return $this->rootNode;
7+ }
8+
9+ - $parts = explode('/', $path);
10+ $node = $this->rootNode;
11+
12+ + // look for any cached parent and collect the parts below the parent
13+ + $parts = [];
14+ + $remainingPath = $path;
15+ + do {
16+ + list($remainingPath, $baseName) = Uri\split($remainingPath);
17+ + array_unshift($parts, $baseName);
18+ +
19+ + if (isset($this->cache[$remainingPath])) {
20+ + $node = $this->cache[$remainingPath];
21+ + break;
22+ + }
23+ + } while ('' !== $remainingPath);
24+ +
25+ while (count($parts)) {
26+ if (!($node instanceof ICollection)) {
27+ throw new Exception\NotFound('Could not find node at path: '.$path);
Original file line number Diff line number Diff line change 11{
22 "patches" : {
3+ "sabre/dav" : {
4+ "Fix getNodeForPath cache" : " .patches/fix-cache-for-node.diff"
5+ }
6+
37 }
48}
Original file line number Diff line number Diff line change 39123912 " bin/naturalselection"
39133913 ],
39143914 "type" : " library" ,
3915+ "extra" : {
3916+ "patches_applied" : {
3917+ "Fix getNodeForPath cache" : " .patches/fix-cache-for-node.diff"
3918+ }
3919+ },
39153920 "installation-source" : " dist" ,
39163921 "autoload" : {
39173922 "psr-4" : {
Original file line number Diff line number Diff line change 33 'name ' => 'nextcloud/3rdparty ' ,
44 'pretty_version ' => 'dev-master ' ,
55 'version ' => 'dev-master ' ,
6- 'reference ' => 'd7b9f6f5f0513adc3ed652eb84b1822fb5b53032 ' ,
6+ 'reference ' => '330abb953111fee49cd2577b42dcd54712bdb8b0 ' ,
77 'type ' => 'library ' ,
88 'install_path ' => __DIR__ . '/../ ' ,
99 'aliases ' => array (),
310310 'nextcloud/3rdparty ' => array (
311311 'pretty_version ' => 'dev-master ' ,
312312 'version ' => 'dev-master ' ,
313- 'reference ' => 'd7b9f6f5f0513adc3ed652eb84b1822fb5b53032 ' ,
313+ 'reference ' => '330abb953111fee49cd2577b42dcd54712bdb8b0 ' ,
314314 'type ' => 'library ' ,
315315 'install_path ' => __DIR__ . '/../ ' ,
316316 'aliases ' => array (),
Original file line number Diff line number Diff line change 1+ This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)
2+ Patches applied to this directory:
3+
4+ Fix getNodeForPath cache
5+ Source: .patches/fix-cache-for-node.diff
6+
7+
Original file line number Diff line number Diff line change @@ -62,9 +62,21 @@ public function getNodeForPath($path)
6262 return $ this ->rootNode ;
6363 }
6464
65- $ parts = explode ('/ ' , $ path );
6665 $ node = $ this ->rootNode ;
6766
67+ // look for any cached parent and collect the parts below the parent
68+ $ parts = [];
69+ $ remainingPath = $ path ;
70+ do {
71+ list ($ remainingPath , $ baseName ) = Uri \split ($ remainingPath );
72+ array_unshift ($ parts , $ baseName );
73+
74+ if (isset ($ this ->cache [$ remainingPath ])) {
75+ $ node = $ this ->cache [$ remainingPath ];
76+ break ;
77+ }
78+ } while ('' !== $ remainingPath );
79+
6880 while (count ($ parts )) {
6981 if (!($ node instanceof ICollection)) {
7082 throw new Exception \NotFound ('Could not find node at path: ' .$ path );
You can’t perform that action at this time.
0 commit comments