{event name='stylesheets'}
<!-- Icons -->
-<link rel="icon" href="{@$__wcf->getPath()}images/favicon.ico" type="image/x-icon" />
+<link rel="icon" href="{@$__wcf->getFavicon()}" type="image/x-icon" />
<link rel="apple-touch-icon" href="{@$__wcf->getPath()}images/apple-touch-icon.png" />
<script data-relocate="true">
return substr(sha1(preg_replace('~^https~', 'http', self::getPath())), 0, 8);
}
+ /**
+ * Returns the favicon URL or a base64 encoded image.
+ *
+ * @return string
+ */
+ public function getFavicon() {
+ $activeApplication = ApplicationHandler::getInstance()->getActiveApplication();
+ $primaryApplication = ApplicationHandler::getInstance()->getPrimaryApplication();
+
+ if ($activeApplication->domainName != $primaryApplication->domainName) {
+ if (file_exists(WCF_DIR.'images/favicon.ico')) {
+ $favicon = file_get_contents(WCF_DIR.'images/favicon.ico');
+
+ return 'data:image/x-icon;base64,' . base64_encode($favicon);
+ }
+ }
+
+ return WCF::getPath() . 'images/favicon.ico';
+ }
+
/**
* Initialises the cronjobs.
*/