From 72eca8cdb13ad33d790ca177a10612f661c277e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 27 Mar 2014 18:40:54 +0100 Subject: [PATCH] Disallow overwriting existing applications by using relative paths see https://www.woltlab.com/forum/index.php/Thread/222390-%C3%9Cberschreiben-von-Endanwendungen-m%C3%B6glich/ --- .../lib/system/package/PackageInstallationDispatcher.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 62d8836580..826dc8ecc5 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -693,7 +693,8 @@ class PackageInstallationDispatcher { else { $document = PackageInstallationFormManager::getForm($this->queue, 'packageDir'); $document->handleRequest(); - $packageDir = FileUtil::addTrailingSlash(FileUtil::unifyDirSeparator($document->getValue('packageDir'))); + $packageDir = FileUtil::addTrailingSlash(FileUtil::getRealPath(FileUtil::unifyDirSeparator($document->getValue('packageDir')))); + if ($packageDir === '/') $packageDir = ''; if ($packageDir !== null) { // validate package dir -- 2.20.1