From: Alexander Ebert Date: Thu, 26 Nov 2015 18:42:22 +0000 (+0100) Subject: Allow only updating controller X-Git-Tag: 3.0.0_Beta_1~2030^2~234^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2206e279912f517da0d2c09f32c2c01140b36f68;p=GitHub%2FWoltLab%2FWCF.git Allow only updating controller --- diff --git a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php index 34c3e30410..98806f9288 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/PagePackageInstallationPlugin.class.php @@ -170,8 +170,20 @@ class PagePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin $content = $data['content']; unset($data['content']); - // import or update action - $object = parent::import($row, $data); + if ($row !== false) { + // allow only updating of controller, everything else would overwrite user modifications + if (!empty($data['controller'])) { + $object = parent::import($row, ['controller' => $data['controller']]); + } + else { + $baseClass = call_user_func(array($this->className, 'getBaseClass')); + $object = new $baseClass(null, $row); + } + } + else { + // import + $object = parent::import($row, $data); + } // store content for later import $this->content[$object->pageID] = $content;