aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/workflowengine/lib/Check/FileMimeType.php8
-rw-r--r--apps/workflowengine/lib/Check/RequestURL.php4
-rw-r--r--apps/workflowengine/tests/Check/FileMimeTypeTest.php4
3 files changed, 8 insertions, 8 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/')
);
}
}
diff --git a/apps/workflowengine/tests/Check/FileMimeTypeTest.php b/apps/workflowengine/tests/Check/FileMimeTypeTest.php
index 3ebcaa8f4b3..c52da9e7b53 100644
--- a/apps/workflowengine/tests/Check/FileMimeTypeTest.php
+++ b/apps/workflowengine/tests/Check/FileMimeTypeTest.php
@@ -68,7 +68,7 @@ class FileMimeTypeTest extends TestCase {
$this->mimeDetector->method('detectPath')
->willReturnCallback(function ($path) {
foreach ($this->extensions as $extension => $mime) {
- if (strpos($path, $extension) !== false) {
+ if (str_contains($path, $extension)) {
return $mime;
}
}
@@ -78,7 +78,7 @@ class FileMimeTypeTest extends TestCase {
->willReturnCallback(function ($path) {
$body = file_get_contents($path);
foreach ($this->content as $match => $mime) {
- if (strpos($body, $match) !== false) {
+ if (str_contains($body, $match)) {
return $mime;
}
}