Use `str_contains()` instead of `strpos() !== false` in StyleEditor
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 26 Jan 2022 09:37:06 +0000 (10:37 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 26 Jan 2022 09:37:06 +0000 (10:37 +0100)
wcfsetup/install/files/lib/data/style/StyleEditor.class.php

index 440faaa2fe5d4e96312a35ff549c5f8f6ba34d6a..cc64f0102e694ecb78ba65c5e4f08ae84ff6b031 100644 (file)
@@ -694,12 +694,12 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                             continue;
                         }
 
-                        if (\strpos($path, '../') !== false) {
+                        if (\str_contains($path, '../')) {
                             continue;
                         }
 
                         $targetFile = FileUtil::getRealPath($style->getAssetPath() . $path);
-                        if (\strpos(FileUtil::getRelativePath($style->getAssetPath(), $targetFile), '../') !== false) {
+                        if (\str_contains(FileUtil::getRelativePath($style->getAssetPath(), $targetFile), '../')) {
                             continue;
                         }