diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2023-08-07 09:10:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-07 09:10:43 +0200 |
commit | bfe42de8f878985c75c6f0bb868b905fe293d8da (patch) | |
tree | e52c4d55a622533f171c2079e8e125f8bd147cfe /apps/workflowengine/lib | |
parent | 97ad1fbd96086bb57bf89bd5e40bfabe25d699fd (diff) | |
parent | 9d15e6e21da653beab4837bfd439ff2a13bf749c (diff) | |
download | nextcloud-server-bfe42de8f878985c75c6f0bb868b905fe293d8da.tar.gz nextcloud-server-bfe42de8f878985c75c6f0bb868b905fe293d8da.zip |
Merge pull request #38604 from fsamapoor/replace_strpos_calls_in_workflowengine_app
Refactors "strpos" calls in /apps/workflowengine
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 dfcfed9466b..a167baa47a3 100644 --- a/apps/workflowengine/lib/Check/FileMimeType.php +++ b/apps/workflowengine/lib/Check/FileMimeType.php @@ -151,11 +151,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/') ); } @@ -165,7 +165,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..deff68826f2 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/') ); } } |