Flip only the file name casing on AbstractFileDeletePackageInstallationPlugin::isFile...
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 9 May 2022 09:06:38 +0000 (11:06 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 9 May 2022 09:06:38 +0000 (11:06 +0200)
Flipping the whole path does not provide any real benefit, because we only care
about whether the file system where WoltLab Suite resides is case sensitive or
not. It does however break when `open_basedir` is configured.

wcfsetup/install/files/lib/system/package/plugin/AbstractFileDeletePackageInstallationPlugin.class.php

index f33355f7d79da8846c9d6be36a2dbe86eed3f486..e9fc52b86cb818c98d0ef5733835bd04cf8b7e0f 100644 (file)
@@ -136,10 +136,14 @@ abstract class AbstractFileDeletePackageInstallationPlugin extends AbstractXMLPa
         if ($isFilesystemCaseSensitive === null) {
             $testFilePath = __FILE__;
 
-            $invertedCase = \strtr(
-                $testFilePath,
-                "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
-                "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+            $invertedCase = \sprintf(
+                '%s/%s',
+                \dirname($testFilePath),
+                \strtr(
+                    \basename($testFilePath),
+                    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
+                    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                )
             );
 
             $isFilesystemCaseSensitive = !\file_exists($invertedCase);