From: Tim Düsterhus Date: Mon, 9 May 2022 09:06:38 +0000 (+0200) Subject: Flip only the file name casing on AbstractFileDeletePackageInstallationPlugin::isFile... X-Git-Tag: 5.5.0_Beta_1~6^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d0187242c8670a9972e6d803a3c6ea750febb8c6;p=GitHub%2FWoltLab%2FWCF.git Flip only the file name casing on AbstractFileDeletePackageInstallationPlugin::isFilesystemCaseSensitive() 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. --- diff --git a/wcfsetup/install/files/lib/system/package/plugin/AbstractFileDeletePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/AbstractFileDeletePackageInstallationPlugin.class.php index f33355f7d7..e9fc52b86c 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/AbstractFileDeletePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/AbstractFileDeletePackageInstallationPlugin.class.php @@ -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);