Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/Operation.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,7 +36,7 @@
use OCP\BackgroundJob\IJobList;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\GenericEvent;
use OCP\Files\Folder;
use OCP\Files\File as FileNode;
use OCP\Files\InvalidPathException;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
Expand DownExpand Up@@ -145,7 +145,7 @@ public function onEvent(string $eventName, Event $event, IRuleMatcher $ruleMatch

// '', admin, 'files', 'path/to/file.txt'
[, , $folder,] = explode('/', $node->getPath(), 4);
if ($folder !== 'files' || $node instanceof Folder) {
if ($folder !== 'files' || !($node instanceof FileNode)) {
return;
}

Expand DownExpand Up@@ -196,9 +196,7 @@ protected function buildCommand(string $template, Node $node, string $event, arr
if (strpos($command, '%f')) {
try {
$view = new View();
if ($node instanceof Folder) {
$fullPath = $view->getLocalFolder($node->getPath());
} else {
if ($node instanceof FileNode) {
$fullPath = $view->getLocalFile($node->getPath());
}
if ($fullPath === null) {
Expand Down