From: Tim Düsterhus Date: Fri, 24 Jul 2020 12:13:48 +0000 (+0200) Subject: Unbreak WCFSetup X-Git-Tag: 5.3.0_Alpha_1~118^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=81ea4f55ff0349d1dec17c5859f07e9134fb496a;p=GitHub%2FWoltLab%2FWCF.git Unbreak WCFSetup --- diff --git a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php index 276d5fc7f7..8ac5f06fe3 100644 --- a/wcfsetup/install/files/lib/data/style/StyleEditor.class.php +++ b/wcfsetup/install/files/lib/data/style/StyleEditor.class.php @@ -362,9 +362,10 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject * @param string $filename * @param integer $packageID * @param StyleEditor $style + * @param boolean $skipFontDownload * @return StyleEditor */ - public static function import($filename, $packageID = 1, StyleEditor $style = null) { + public static function import($filename, $packageID = 1, StyleEditor $style = null, $skipFontDownload = false) { // open file $tar = new Tar($filename); @@ -659,14 +660,16 @@ class StyleEditor extends DatabaseObjectEditor implements IEditableCachedObject } } - // download google fonts - $fontManager = FontManager::getInstance(); - $family = $style->getVariable('wcfFontFamilyGoogle'); - try { - $fontManager->downloadFamily($family); - } - catch (FontDownloadFailed $e) { - // ignore + if (!$skipFontDownload) { + // download google fonts + $fontManager = FontManager::getInstance(); + $family = $style->getVariable('wcfFontFamilyGoogle'); + try { + $fontManager->downloadFamily($family); + } + catch (FontDownloadFailed $e) { + // ignore + } } $tar->close(); diff --git a/wcfsetup/install/files/lib/system/package/plugin/StylePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/StylePackageInstallationPlugin.class.php index 6b2cd2bd96..5c67bb0419 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/StylePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/StylePackageInstallationPlugin.class.php @@ -32,7 +32,7 @@ class StylePackageInstallationPlugin extends AbstractPackageInstallationPlugin { $styleEditor = StyleHandler::getInstance()->getStyleByName($this->installation->getPackageName(), false); // import style - $style = StyleEditor::import($filename, $this->installation->getPackageID(), $styleEditor); + $style = StyleEditor::import($filename, $this->installation->getPackageID(), $styleEditor, !PACKAGE_ID); // set style as default if (isset($this->instruction['attributes']['default'])) { diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index 534d696a9b..354ae05928 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -275,7 +275,7 @@ class StyleCompiler extends SingletonFactory { } // add google fonts - if (!empty($variables['wcfFontFamilyGoogle'])) { + if (!empty($variables['wcfFontFamilyGoogle']) && PACKAGE_ID) { $cssFile = FontManager::getInstance()->getCssFilename(substr($variables['wcfFontFamilyGoogle'], 1, -1)); if (is_readable($cssFile)) { $content .= file_get_contents($cssFile);