From d0187242c8670a9972e6d803a3c6ea750febb8c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 9 May 2022 11:06:38 +0200 Subject: [PATCH] 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. --- ...ractFileDeletePackageInstallationPlugin.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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); -- 2.20.1