Force skip of system critical templates on style export
authorAlexander Ebert <ebert@woltlab.com>
Tue, 18 Jul 2017 12:32:11 +0000 (14:32 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 18 Jul 2017 12:32:11 +0000 (14:32 +0200)
See #2335

wcfsetup/install/files/lib/data/style/StyleEditor.class.php

index 6d2a2f8dc8e4cd64449012bc7bf7d9053a2761d2..a00a0d8d95533de77bbc58b0239ae077c5312a7a 100644 (file)
@@ -6,6 +6,7 @@ use wcf\data\package\Package;
 use wcf\data\package\PackageCache;
 use wcf\data\template\group\TemplateGroup;
 use wcf\data\template\group\TemplateGroupAction;
+use wcf\data\template\Template;
 use wcf\data\template\TemplateEditor;
 use wcf\data\DatabaseObjectEditor;
 use wcf\data\IEditableCachedObject;
@@ -730,6 +731,10 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject
                                $packageDir = 'com.woltlab.wcf';
                                $package = null;
                                
+                               if (Template::isSystemCritical($row['templateName'])) {
+                                       continue;
+                               }
+                               
                                if ($row['application'] != 'wcf') {
                                        $application = ApplicationHandler::getInstance()->getApplication($row['application']);
                                        $package = PackageCache::getInstance()->getPackage($application->packageID);