diff options
author | Faraz Samapoor <fsamapoor@gmail.com> | 2023-05-15 15:17:19 +0330 |
---|---|---|
committer | Faraz Samapoor <fsamapoor@gmail.com> | 2023-05-15 15:17:19 +0330 |
commit | e7cc7653b885c49b1b3f0a78f91ea05a53e102d8 (patch) | |
tree | 42da61d5c6e988d7c9eff7e081327a73f661dc89 /lib/private/Log.php | |
parent | 8bdb50fd507bfe68161ab98eba903872083ea4f3 (diff) | |
download | nextcloud-server-e7cc7653b885c49b1b3f0a78f91ea05a53e102d8.tar.gz nextcloud-server-e7cc7653b885c49b1b3f0a78f91ea05a53e102d8.zip |
Refactors "strpos" calls in lib/private to improve code readability.
Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
Diffstat (limited to 'lib/private/Log.php')
-rw-r--r-- | lib/private/Log.php | 6 |
1 files changed, 3 insertions, 3 deletions
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; } } |