From e6d1f430aa459ee2f5d925c8fa3f5e30a461a71e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 7 Jul 2021 18:16:32 +0200 Subject: [PATCH] Do not block matching abbreviation if the package is the same The previous code would block the installation of an update of the same package. Fix for #4357 --- .../package/validation/PackageValidationArchive.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php b/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php index 9383be3072..ee277e9661 100644 --- a/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php @@ -203,10 +203,11 @@ class PackageValidationArchive implements \RecursiveIterator protected function validateApplication(): void { if ($this->archive->getPackageInfo('isApplication')) { - $abbreviation = Package::getAbbreviation($this->archive->getPackageInfo('name')); + $identifier = $this->archive->getPackageInfo('name'); + $abbreviation = Package::getAbbreviation($identifier); $application = ApplicationHandler::getInstance()->getApplication($abbreviation); - if ($application !== null) { + if ($application !== null && $application->getPackage()->package !== $identifier) { throw new PackageValidationException(PackageValidationException::DUPLICATE_ABBREVIATION, [ 'packageName' => $this->archive->getPackageInfo('name'), 'application' => $application, -- 2.20.1