File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
apps/dav/lib/Connector/Sabre Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -422,14 +422,15 @@ private function getPartFileBasePath($path) {
422
422
}
423
423
}
424
424
425
- /**
426
- * @param string $path
427
- */
428
- private function emitPreHooks ($ exists , $ path = null ) {
425
+ private function emitPreHooks (bool $ exists , ?string $ path = null ): bool {
429
426
if (is_null ($ path )) {
430
427
$ path = $ this ->path ;
431
428
}
432
429
$ hookPath = Filesystem::getView ()->getRelativePath ($ this ->fileView ->getAbsolutePath ($ path ));
430
+ if ($ hookPath === null ) {
431
+ // We only trigger hooks from inside default view
432
+ return true ;
433
+ }
433
434
$ run = true ;
434
435
435
436
if (!$ exists ) {
@@ -450,14 +451,15 @@ private function emitPreHooks($exists, $path = null) {
450
451
return $ run ;
451
452
}
452
453
453
- /**
454
- * @param string $path
455
- */
456
- private function emitPostHooks ($ exists , $ path = null ) {
454
+ private function emitPostHooks (bool $ exists , ?string $ path = null ): void {
457
455
if (is_null ($ path )) {
458
456
$ path = $ this ->path ;
459
457
}
460
458
$ hookPath = Filesystem::getView ()->getRelativePath ($ this ->fileView ->getAbsolutePath ($ path ));
459
+ if ($ hookPath === null ) {
460
+ // We only trigger hooks from inside default view
461
+ return ;
462
+ }
461
463
if (!$ exists ) {
462
464
\OC_Hook::emit (\OC \Files \Filesystem::CLASSNAME , \OC \Files \Filesystem::signal_post_create, [
463
465
\OC \Files \Filesystem::signal_param_path => $ hookPath
Original file line number Diff line number Diff line change 1
1
<?php
2
+
3
+ declare (strict_types=1 );
4
+
2
5
/**
3
6
* @copyright Copyright (c) 2016, ownCloud, Inc.
4
7
*
@@ -223,7 +226,7 @@ public function read($arguments) {
223
226
$ this ->dispatcher ->dispatchTyped ($ event );
224
227
}
225
228
226
- private function getNodeForPath ($ path ) {
229
+ private function getNodeForPath (string $ path ): Node {
227
230
$ info = Filesystem::getView ()->getFileInfo ($ path );
228
231
if (!$ info ) {
229
232
$ fullPath = Filesystem::getView ()->getAbsolutePath ($ path );
You can’t perform that action at this time.
0 commit comments