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/LargeFileHelper.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/LargeFileHelper.php')
-rwxr-xr-x | lib/private/LargeFileHelper.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/LargeFileHelper.php b/lib/private/LargeFileHelper.php index c8d6ba42eb5..40cf2ecd5ff 100755 --- a/lib/private/LargeFileHelper.php +++ b/lib/private/LargeFileHelper.php @@ -150,9 +150,9 @@ class LargeFileHelper { $os = strtolower(php_uname('s')); $arg = escapeshellarg($filename); $result = null; - if (strpos($os, 'linux') !== false) { + if (str_contains($os, 'linux')) { $result = $this->exec("stat -c %s $arg"); - } elseif (strpos($os, 'bsd') !== false || strpos($os, 'darwin') !== false) { + } elseif (str_contains($os, 'bsd') || str_contains($os, 'darwin')) { $result = $this->exec("stat -f %z $arg"); } return $result; @@ -193,7 +193,7 @@ class LargeFileHelper { if ($result < 0) { if (\OCP\Util::isFunctionEnabled('exec')) { $os = strtolower(php_uname('s')); - if (strpos($os, 'linux') !== false) { + if (str_contains($os, 'linux')) { return (int)($this->exec('stat -c %Y ' . escapeshellarg($fullPath)) ?? -1); } } |