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/Log.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/private/Log.php') diff --git a/lib/private/Log.php b/lib/private/Log.php index c139510a3b3..99797b938db 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -242,8 +242,8 @@ class Log implements ILogger, IDataLogger { $request = \OC::$server->getRequest(); if ($request->getMethod() === 'PUT' && - strpos($request->getHeader('Content-Type'), 'application/x-www-form-urlencoded') === false && - strpos($request->getHeader('Content-Type'), 'application/json') === false) { + !str_contains($request->getHeader('Content-Type'), 'application/x-www-form-urlencoded') && + !str_contains($request->getHeader('Content-Type'), 'application/json')) { $logSecretRequest = ''; } else { $logSecretRequest = $request->getParam('log_secret', ''); @@ -391,7 +391,7 @@ class Log implements ILogger, IDataLogger { foreach ($context as $key => $val) { $fullKey = '{' . $key . '}'; $replace[$fullKey] = $val; - if (strpos($message, $fullKey) !== false) { + if (str_contains($message, $fullKey)) { $usedContextKeys[$key] = true; } } -- cgit v1.2.3