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/Storage/Wrapper/Encryption.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/private/Files/Storage/Wrapper/Encryption.php') diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 9c0e6c91463..ab3873a7ec0 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -922,7 +922,7 @@ class Encryption extends Wrapper { } $firstBlock = $this->readFirstBlock($path); - if (substr($firstBlock, 0, strlen(Util::HEADER_START)) === Util::HEADER_START) { + if (str_starts_with($firstBlock, Util::HEADER_START)) { $headerSize = $this->util->getHeaderSize(); } @@ -937,7 +937,7 @@ class Encryption extends Wrapper { */ protected function parseRawHeader($rawHeader) { $result = []; - if (substr($rawHeader, 0, strlen(Util::HEADER_START)) === Util::HEADER_START) { + if (str_starts_with($rawHeader, Util::HEADER_START)) { $header = $rawHeader; $endAt = strpos($header, Util::HEADER_END); if ($endAt !== false) { -- cgit v1.2.3