From 6990fa8341ec8c5f688509f4b68bb2e29db02584 Mon Sep 17 00:00:00 2001 From: joshuaruesweg Date: Mon, 28 Mar 2022 10:58:58 +0200 Subject: [PATCH] Enforce unique names for acp search providers --- ...PSearchProviderPackageInstallationPlugin.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php index 091efba235..52f18da9a7 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php @@ -28,7 +28,8 @@ use wcf\system\WCF; * @package WoltLabSuite\Core\System\Package\Plugin */ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin implements - IGuiPackageInstallationPlugin + IGuiPackageInstallationPlugin, + IUniqueNameXMLPackageInstallationPlugin { use TXmlGuiPackageInstallationPlugin; @@ -101,6 +102,14 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta ACPSearchProviderCacheBuilder::getInstance()->reset(); } + /** + * @inheritDoc + */ + public function getNameByData(array $data): string + { + return $data['providerName']; + } + /** * @see \wcf\system\package\plugin\IPackageInstallationPlugin::getDefaultFilename() * @since 3.0 -- 2.20.1