|
23 | 23 |
|
24 | 24 | namespace OCA\WorkflowScript;
|
25 | 25 |
|
26 |
| -use OC\Files\View; |
27 | 26 | use OC\Files\Filesystem;
|
| 27 | +use OC\Files\View; |
28 | 28 | use OCA\WorkflowEngine\Entity\File;
|
29 | 29 | use OCA\WorkflowScript\BackgroundJobs\Launcher;
|
30 | 30 | use OCP\BackgroundJob\IJobList;
|
|
35 | 35 | use OCP\Files\IRootFolder;
|
36 | 36 | use OCP\Files\Node;
|
37 | 37 | use OCP\Files\NotFoundException;
|
| 38 | +use OCP\IConfig; |
38 | 39 | use OCP\IL10N;
|
39 | 40 | use OCP\IUser;
|
40 | 41 | use OCP\IUserSession;
|
41 |
| -use OCP\IConfig; |
42 | 42 | use OCP\SystemTag\MapperEvent;
|
43 | 43 | use OCP\WorkflowEngine\IManager;
|
44 | 44 | use OCP\WorkflowEngine\IRuleMatcher;
|
@@ -78,17 +78,17 @@ protected function buildCommand(string $template, Node $node, string $event, arr
|
78 | 78 |
|
79 | 79 | if (strpos($command, '%n')) {
|
80 | 80 | // Nextcloud relative-path
|
81 |
| - $nodeID = -1; |
82 |
| - try { |
83 |
| - $nodeID = $node->getId(); |
84 |
| - } catch (InvalidPathException $e) { |
85 |
| - } catch (NotFoundException $e) { |
| 81 | + $nodeID = -1; |
| 82 | + try { |
| 83 | + $nodeID = $node->getId(); |
| 84 | + } catch (InvalidPathException $e) { |
| 85 | + } catch (NotFoundException $e) { |
86 | 86 | }
|
87 |
| - |
| 87 | + |
88 | 88 | $base_path = $this->config->getSystemValue('datadirectory');
|
89 |
| - |
| 89 | + |
90 | 90 | $path = Filesystem::getLocalFile(Filesystem::getPath($nodeID));
|
91 |
| - $command = str_replace('%n', escapeshellarg(str_replace($base_path . '/','',$path)), $command); |
| 91 | + $command = str_replace('%n', escapeshellarg(str_replace($base_path . '/', '', $path)), $command); |
92 | 92 | }
|
93 | 93 |
|
94 | 94 | if (false && strpos($command, '%f')) {
|
|
0 commit comments