From: Alexander Ebert Date: Fri, 12 Oct 2012 01:29:24 +0000 (+0200) Subject: Fixed method to export styles X-Git-Tag: 2.0.0_Beta_1~905 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f55b204fd42852e836cd21d2c1d240a083f3f31c;p=GitHub%2FWoltLab%2FWCF.git Fixed method to export styles --- diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index cb4c386517..593c76d993 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -13,6 +13,7 @@ use wcf\system\io\File; use wcf\system\io\Tar; use wcf\system\io\TarWriter; use wcf\system\style\StyleCompiler; +use wcf\system\Regex; use wcf\system\WCF; use wcf\util\DateUtil; use wcf\util\FileUtil; @@ -536,36 +537,33 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject * @param boolean $icons */ public function export($templates = false, $images = false, $icons = false) { - // TODO: Fix this method! - throw new SystemException("FIX ME!"); - // create style tar $styleTarName = FileUtil::getTemporaryFilename('style_', '.tgz'); $styleTar = new TarWriter($styleTarName, true); // append style preview image - if ($this->image && @file_exists(WCF_DIR.$this->image)) { - $styleTar->add(WCF_DIR.$this->image, '', FileUtil::addTrailingSlash(dirname(WCF_DIR.$this->image))); + if ($this->image && @file_exists(WCF_DIR.'images/'.$this->image)) { + $styleTar->add(WCF_DIR.'images/'.$this->image, '', FileUtil::addTrailingSlash(dirname(WCF_DIR.'images/'.$this->image))); } // create style info file - $string = "\n\n