From ee8d703a72f92c6186a2d3aad8076d9e7cda634c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 18 Dec 2013 01:17:56 +0100 Subject: [PATCH] Prevent BBCodes being overwritten through 3rd party packages --- .../plugin/BBCodePackageInstallationPlugin.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php index 9c18d0b191..f0bd41252e 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/BBCodePackageInstallationPlugin.class.php @@ -1,6 +1,7 @@ findExistingItem($data); + $statement = WCF::getDB()->prepareStatement($sqlData['sql']); + $statement->execute($sqlData['parameters']); + $row = $statement->fetchArray(); + if ($row && $row['packageID'] != $this->installation->getPackageID()) { + $package = PackageCache::getInstance()->getPackage($row['packageID']); + throw new SystemException("BBCode '" . $data['bbcodeTag'] . "' is already provided by '" . $package . "' ('" . $package->package . "')."); + } } /** -- 2.20.1