(bug 19392) Favicon, apple-touch-icon links matching the defaults should not be sent
authorChad Horohoe <demon@users.mediawiki.org>
Mon, 27 Jul 2009 23:42:58 +0000 (23:42 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Mon, 27 Jul 2009 23:42:58 +0000 (23:42 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/Skin.php

index 4f5fd47..837157f 100644 (file)
@@ -341,6 +341,8 @@ this. Was used when mwEmbed was going to be an extension.
 * (bugs 18407, 18409) Special:Upload is now listed on Special:Specialpages only
   if uploads are enabled and the user can access it
 * (bug 17988) Spaces before [[Category:]] links are no longer ignored
+* (bug 19392) Favicon, apple-touch-icon links matching the defaults are no 
+  longer sent
 
 == API changes in 1.16 ==
 
index 3f09a6b..f673686 100644 (file)
@@ -156,7 +156,7 @@ $wgUploadPath       = false; ///< defaults to "{$wgScriptPath}/images"
 $wgUploadDirectory     = false; ///< defaults to "{$IP}/images"
 $wgHashedUploadDirectory       = true;
 $wgLogo                                = false; ///< defaults to "{$wgStylePath}/common/images/wiki.png"
-$wgFavicon                     = '/favicon.ico';
+$wgFavicon                     = false; ///< will be treated as '/favicon.ico' anyway by user agents
 $wgAppleTouchIcon   = false; ///< This one'll actually default to off. For iPhone and iPod Touch web app bookmarks
 $wgMathPath         = false; ///< defaults to "{$wgUploadPath}/math"
 $wgMathDirectory    = false; ///< defaults to "{$wgUploadDirectory}/math"
index 6440bf0..d04779e 100644 (file)
@@ -178,15 +178,17 @@ class Skin extends Linker {
 
                wfProfileIn( __METHOD__ );
 
+               # Add favicons and Apple touch icons, if they're not the defaults
+               #
                # Generally the order of the favicon and apple-touch-icon links
                # should not matter, but Konqueror (3.5.9 at least) incorrectly
                # uses whichever one appears later in the HTML source.  Make sure
                # apple-touch-icon is specified first to avoid this.
-               if( false !== $wgAppleTouchIcon ) {
+               if( false !== $wgAppleTouchIcon && wfExpandUrl('/apple-touch-icon.png') != wfExpandUrl($wgAppleTouchIcon) ) {
                        $out->addLink( array( 'rel' => 'apple-touch-icon', 'href' => $wgAppleTouchIcon ) );
                }
 
-               if( false !== $wgFavicon ) {
+               if( false !== $wgFavicon && wfExpandUrl('/favicon.ico') != wfExpandUrl($wgFavicon) ) {
                        $out->addLink( array( 'rel' => 'shortcut icon', 'href' => $wgFavicon ) );
                }