From: Alexander Ebert Date: Wed, 7 Jul 2021 16:16:32 +0000 (+0200) Subject: Do not block matching abbreviation if the package is the same X-Git-Tag: 5.4.0_RC_2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e6d1f430aa459ee2f5d925c8fa3f5e30a461a71e;p=GitHub%2FWoltLab%2FWCF.git 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 --- 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,