From: Tim Düsterhus Date: Tue, 28 Jul 2020 12:18:10 +0000 (+0200) Subject: Inject proper getFont() version depending on isMultiDomainSetup() X-Git-Tag: 5.3.0_Alpha_1~115^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d227e052c9180197404090851eb94f14730a7546;p=GitHub%2FWoltLab%2FWCF.git Inject proper getFont() version depending on isMultiDomainSetup() --- 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) {