Remove the use of WCF::getFavicon()
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 10:58:23 +0000 (12:58 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 12:24:41 +0000 (14:24 +0200)
This method was required to correctly handle multi-domain setups and thus is
obsolete.

com.woltlab.wcf/templates/headInclude.tpl
wcfsetup/install/files/lib/system/WCF.class.php

index da2b9a2b8831c7e51d935ce40c49faeb9f8471b4..a301055c50df43104a3f4b2187bf5e35fb99c4e1 100644 (file)
@@ -26,7 +26,7 @@
 <!-- Icons -->
 <link rel="apple-touch-icon" sizes="180x180" href="{$__wcf->getStyleHandler()->getStyle()->getFaviconAppleTouchIcon()}">
 <link rel="manifest" href="{@$__wcf->getStyleHandler()->getStyle()->getFaviconManifest()}">
-<link rel="shortcut icon" href="{@$__wcf->getFavicon()}">
+<link rel="shortcut icon" href="{$__wcf->getPath()}{$__wcf->getStyleHandler()->getStyle()->getRelativeFavicon()}">
 <meta name="msapplication-config" content="{@$__wcf->getStyleHandler()->getStyle()->getFaviconBrowserconfig()}">
 <meta name="theme-color" content="{$__wcf->getStyleHandler()->getStyle()->getVariable('wcfPageThemeColor', true)}">
 
index 924f3c92e41278a7831ba13e0e6e724103bb3809..f52b9dcc6601be32e2c1efffa10d82f26d1d3bcc 100644 (file)
@@ -1153,24 +1153,12 @@ class WCF
     }
 
     /**
-     * Returns the favicon URL or a base64 encoded image.
-     *
-     * @return  string
+     * @deprecated 5.6 Use ActiveStyle::getRelativeFavicon() directly.
      */
     public function getFavicon()
     {
-        $activeApplication = ApplicationHandler::getInstance()->getActiveApplication();
-        $wcf = ApplicationHandler::getInstance()->getWCF();
         $favicon = StyleHandler::getInstance()->getStyle()->getRelativeFavicon();
 
-        if ($activeApplication->domainName !== $wcf->domainName) {
-            if (\file_exists(WCF_DIR . $favicon)) {
-                $favicon = \file_get_contents(WCF_DIR . $favicon);
-
-                return 'data:image/x-icon;base64,' . \base64_encode($favicon);
-            }
-        }
-
         return self::getPath() . $favicon;
     }