From: Marcel Werk Date: Thu, 9 May 2013 22:29:38 +0000 (+0200) Subject: Fixed style import X-Git-Tag: 2.0.0_Beta_1~217 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=689f5bd0585f8bbef82b3521914179bf081f4d7d;p=GitHub%2FWoltLab%2FWCF.git Fixed style import Fixes #1266 --- diff --git a/wcfsetup/install/files/lib/acp/form/StyleImportForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleImportForm.class.php index 30ab01af77..1b64ee66ca 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleImportForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleImportForm.class.php @@ -62,11 +62,12 @@ class StyleImportForm extends AbstractForm { throw new UserInputException('source', 'uploadFailed'); } - // get filename - $this->source['name'] = FileUtil::getTemporaryFilename('style_', preg_replace('!^.*(?=\.(?:tar\.gz|tgz|tar)$)!i', '', basename($this->source['name']))); - - if (!@move_uploaded_file($this->source['tmp_name'], $this->source['name'])) { - throw new UserInputException('source', 'uploadFailed'); + try { + $this->style = StyleEditor::import($this->source['tmp_name']); + } + catch (\Exception $e) { + @unlink($this->source['tmp_name']); + throw new UserInputException('source', 'importFailed'); } } @@ -76,14 +77,7 @@ class StyleImportForm extends AbstractForm { public function save() { parent::save(); - try { - $this->style = StyleEditor::import($this->source['name']); - } - catch (\Exception $e) { - @unlink($this->source['name']); - } - - @unlink($this->source['name']); + @unlink($this->source['tmp_name']); $this->saved(); WCF::getTPL()->assign('success', true); diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 83ada74428..3249586ef1 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -631,6 +631,7 @@ + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index dbe285b0d2..65193576e6 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -631,6 +631,7 @@ +