From d227e052c9180197404090851eb94f14730a7546 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 28 Jul 2020 14:18:10 +0200 Subject: [PATCH] Inject proper getFont() version depending on isMultiDomainSetup() --- .../lib/system/style/StyleCompiler.class.php | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php index 5f52db634b..499cefcf34 100644 --- a/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php +++ b/wcfsetup/install/files/lib/system/style/StyleCompiler.class.php @@ -274,24 +274,27 @@ class StyleCompiler extends SingletonFactory { $content .= $this->prepareFile($mixin); } - // getFont helper - $content .= <<<'EOT' -@function getFont($filename, $family: "/", $version: "") { - @if (1 == 1) { - @if ($family != "") { - $family: "families/" + $family + "/"; - } - @if ($version != "") { - $version: "?v=" + $version; + if (ApplicationHandler::getInstance()->isMultiDomainSetup()) { + $content .= <<<'EOT' + @function getFont($filename, $family: "/", $version: "") { + @return "../font/getFont.php?family=" + $family + "&filename=" + $filename + "&v=" + $version; + } +EOT; } - - @return "../font/" + $family + $filename + $version; - } - @else { - @return "../font/getFont.php?family=" + $family + "&filename=" + $filename + "&v=" + $version; - } -} + else { + $content .= <<<'EOT' + @function getFont($filename, $family: "/", $version: "") { + @if ($family != "") { + $family: "families/" + $family + "/"; + } + @if ($version != "") { + $version: "?v=" + $version; + } + + @return "../font/" + $family + $filename + $version; + } EOT; + } // add google fonts if (!empty($variables['wcfFontFamilyGoogle']) && PACKAGE_ID) { -- 2.20.1