From 8cea45f0144d6b986761e8fd3f2a46943ce8982b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 26 Jan 2018 13:12:32 +0100 Subject: [PATCH] Missing recognition of application (acp)templates This change adds support for `acptemplates_.tar` and `templates_.tar` imports. --- .../lib/system/devtools/pip/DevtoolsPip.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php b/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php index a3108ae80d..1f7a52c744 100644 --- a/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php +++ b/wcfsetup/install/files/lib/system/devtools/pip/DevtoolsPip.class.php @@ -271,7 +271,17 @@ class DevtoolsPip extends DatabaseObjectDecorator { case 'file': case 'template': if ($pluginName === 'acpTemplate' || $pluginName === 'template') { - $path = ($pluginName === 'acpTemplate') ? 'acptemplates/' : 'templates/'; + $pathPrefix = ($pluginName === 'acpTemplate') ? 'acptemplates' : 'templates'; + + if (preg_match('~^'.$pathPrefix.'_(?.*)\.tar$~', $target, $match)) { + $path = "{$pathPrefix}_{$match['application']}/"; + + $instructions['attributes'] = ['application' => $match['application']]; + } + else { + $path = "{$pathPrefix}/"; + } + foreach (glob($project->path . $path . '*.tpl') as $template) { $tar->registerFile(basename($template), FileUtil::unifyDirSeparator($template)); } -- 2.20.1