Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-01-11 21:14:28 +0300
committerCarl Schwan <carl@carlschwan.eu>2022-01-11 21:45:07 +0300
commit08bf47a5de019e38754437724767f8e12076d5c0 (patch)
tree76523d7c1e647f3b6f99abb64a4582db4df82925 /apps
parent796764aafd318cfeedf6d19af4551e846a40ac94 (diff)
Fix RequestURL check for cli commands
Fix https://github.com/nextcloud/files_automatedtagging/issues/526 Fix https://github.com/nextcloud/groupfolders/issues/1855 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps')
-rw-r--r--apps/workflowengine/lib/Check/RequestURL.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/apps/workflowengine/lib/Check/RequestURL.php b/apps/workflowengine/lib/Check/RequestURL.php
index 03bb4889e0b..73e6a2e6ce6 100644
--- a/apps/workflowengine/lib/Check/RequestURL.php
+++ b/apps/workflowengine/lib/Check/RequestURL.php
@@ -27,8 +27,9 @@ use OCP\IL10N;
use OCP\IRequest;
class RequestURL extends AbstractStringCheck {
+ public const CLI = 'cli';
- /** @var string */
+ /** @var ?string */
protected $url;
/** @var IRequest */
@@ -49,7 +50,11 @@ class RequestURL extends AbstractStringCheck {
* @return bool
*/
public function executeCheck($operator, $value) {
- $actualValue = $this->getActualValue();
+ if (\OC::$CLI) {
+ $actualValue = $this->url = RequestURL::CLI;
+ } else {
+ $actualValue = $this->getActualValue();
+ }
if (in_array($operator, ['is', '!is'])) {
switch ($value) {
case 'webdav':
@@ -79,10 +84,10 @@ class RequestURL extends AbstractStringCheck {
return $this->url; // E.g. https://localhost/nextcloud/index.php/apps/files_texteditor/ajax/loadfile
}
- /**
- * @return bool
- */
- protected function isWebDAVRequest() {
+ protected function isWebDAVRequest(): bool {
+ if ($this->url === RequestURL::CLI) {
+ return false;
+ }
return substr($this->request->getScriptName(), 0 - strlen('/remote.php')) === '/remote.php' && (
$this->request->getPathInfo() === '/webdav' ||
strpos($this->request->getPathInfo(), '/webdav/') === 0 ||