From e7cc7653b885c49b1b3f0a78f91ea05a53e102d8 Mon Sep 17 00:00:00 2001 From: Faraz Samapoor Date: Mon, 15 May 2023 15:17:19 +0330 Subject: Refactors "strpos" calls in lib/private to improve code readability. Signed-off-by: Faraz Samapoor --- lib/private/Files/ObjectStore/S3Signature.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/private/Files/ObjectStore') diff --git a/lib/private/Files/ObjectStore/S3Signature.php b/lib/private/Files/ObjectStore/S3Signature.php index 64b994bac22..cf3d29c4185 100644 --- a/lib/private/Files/ObjectStore/S3Signature.php +++ b/lib/private/Files/ObjectStore/S3Signature.php @@ -107,7 +107,7 @@ class S3Signature implements SignatureInterface { // Move X-Amz-* headers to the query string foreach ($request->getHeaders() as $name => $header) { $name = strtolower($name); - if (strpos($name, 'x-amz-') === 0) { + if (str_starts_with($name, 'x-amz-')) { $query[$name] = implode(',', $header); } } @@ -169,7 +169,7 @@ class S3Signature implements SignatureInterface { $headers = []; foreach ($request->getHeaders() as $name => $header) { $name = strtolower($name); - if (strpos($name, 'x-amz-') === 0) { + if (str_starts_with($name, 'x-amz-')) { $value = implode(',', $header); if (strlen($value) > 0) { $headers[$name] = $name . ':' . $value; -- cgit v1.2.3