diff options
author | Faraz Samapoor <f.samapoor@gmail.com> | 2023-06-02 14:09:03 +0330 |
---|---|---|
committer | Faraz Samapoor <f.samapoor@gmail.com> | 2023-07-03 13:13:11 +0330 |
commit | 5db241b942d2c9b1809eb8b7ced100b3dac3d7bc (patch) | |
tree | c1b513075cfed3b37e44bc184f4cf5a73190e9c8 /apps/workflowengine/lib | |
parent | 67709b390a74f75f107445d7ad0d6742e1e5896b (diff) | |
download | nextcloud-server-5db241b942d2c9b1809eb8b7ced100b3dac3d7bc.tar.gz nextcloud-server-5db241b942d2c9b1809eb8b7ced100b3dac3d7bc.zip |
Refactors "strpos" calls in /apps/workflowengine to improve code readability.
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
Diffstat (limited to 'apps/workflowengine/lib')
-rw-r--r-- | apps/workflowengine/lib/Check/FileMimeType.php | 8 | ||||
-rw-r--r-- | apps/workflowengine/lib/Check/RequestURL.php | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/apps/workflowengine/lib/Check/FileMimeType.php b/apps/workflowengine/lib/Check/FileMimeType.php index 991d7ebc739..b4094b3675c 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -157,11 +157,11 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck { protected function isWebDAVRequest() { return substr($this->request->getScriptName(), 0 - strlen('/remote.php')) === '/remote.php' && ( $this->request->getPathInfo() === '/webdav' || - strpos($this->request->getPathInfo(), '/webdav/') === 0 || + str_starts_with($this->request->getPathInfo(), '/webdav/') || $this->request->getPathInfo() === '/dav/files' || - strpos($this->request->getPathInfo(), '/dav/files/') === 0 || + str_starts_with($this->request->getPathInfo(), '/dav/files/') || $this->request->getPathInfo() === '/dav/uploads' || - strpos($this->request->getPathInfo(), '/dav/uploads/') === 0 + str_starts_with($this->request->getPathInfo(), '/dav/uploads/') ); } @@ -171,7 +171,7 @@ class FileMimeType extends AbstractStringCheck implements IFileCheck { protected function isPublicWebDAVRequest() { return substr($this->request->getScriptName(), 0 - strlen('/public.php')) === '/public.php' && ( $this->request->getPathInfo() === '/webdav' || - strpos($this->request->getPathInfo(), '/webdav/') === 0 + str_starts_with($this->request->getPathInfo(), '/webdav/') ); } diff --git a/apps/workflowengine/lib/Check/RequestURL.php b/apps/workflowengine/lib/Check/RequestURL.php index 73e6a2e6ce6..806fe1bcefc 100644 --- a/apps/workflowengine/lib/Check/RequestURL.php +++ b/apps/workflowengine/lib/Check/RequestURL.php @@ -90,9 +90,9 @@ class RequestURL extends AbstractStringCheck { } return substr($this->request->getScriptName(), 0 - strlen('/remote.php')) === '/remote.php' && ( $this->request->getPathInfo() === '/webdav' || - strpos($this->request->getPathInfo(), '/webdav/') === 0 || + str_starts_with($this->request->getPathInfo(), '/webdav/') || $this->request->getPathInfo() === '/dav/files' || - strpos($this->request->getPathInfo(), '/dav/files/') === 0 + str_starts_with($this->request->getPathInfo(), '/dav/files/') ); } } |