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/L10N/Factory.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/L10N/Factory.php')
-rw-r--r-- | lib/private/L10N/Factory.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index 1082662933f..778124c4c38 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -539,12 +539,12 @@ class Factory implements IFactory { */ private function isSubDirectory($sub, $parent) { // Check whether $sub contains no ".." - if (strpos($sub, '..') !== false) { + if (str_contains($sub, '..')) { return false; } // Check whether $sub is a subdirectory of $parent - if (strpos($sub, $parent) === 0) { + if (str_starts_with($sub, $parent)) { return true; } |