From: Alexander Ebert Date: Thu, 3 Nov 2011 17:26:21 +0000 (+0100) Subject: Fixed additional data recognition X-Git-Tag: 2.0.0_Beta_1~1626^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=41f6838eea2aaaeb5e070d0cb40e9013d7f13d0e;p=GitHub%2FWoltLab%2FWCF.git Fixed additional data recognition Fixes #242 Fixes #243 --- diff --git a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php index d82c43c066..a1aba22693 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php @@ -29,6 +29,12 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation */ public $tagName = 'type'; + /** + * list of reserved tags + * @var array + */ + public static $reservedTags = array('classname', 'definitionname'); + /** * Gets the definition id by name * @@ -73,11 +79,16 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport() */ protected function prepareImport(array $data) { + $additionalData = array(); + foreach ($data['elements'] as $tagName => $nodeValue) { + if (!in_array($tagName, self::$reservedTags)) $additionalData[$tagName] = $nodeValue; + } + return array( 'definitionID' => $this->getDefinitionID($data['elements']['definitionname']), 'objectType' => $data['elements']['name'], 'className' => (isset($data['elements']['classname']) ? $data['elements']['classname'] : ''), - 'additionalData' => serialize(isset($data['elements']['additionaldata']) ? $data['elements']['additionaldata'] : array()) + 'additionalData' => serialize($additionalData) ); }