favicon fix
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 20 Aug 2006 04:14:56 +0000 (04:14 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 20 Aug 2006 04:14:56 +0000 (04:14 +0000)
opensearch_desc.php

index 6aeacc4..491b05a 100644 (file)
@@ -7,7 +7,13 @@
 require_once( dirname(__FILE__) . '/includes/WebStart.php' );
 $shortName = htmlspecialchars( mb_substr( $wgSitename, 0, 16 ) );
 $siteName = htmlspecialchars( $wgSitename );
-$favicon = htmlspecialchars( $wgFavicon );
+
+if ( !preg_match( '/^https?:/', $wgFavicon ) ) {
+       $favicon = htmlspecialchars( $wgServer . $wgFavicon );
+} else {
+       $favicon = htmlspecialchars( $wgFavicon );
+}
+
 $title = Title::makeTitle( NS_SPECIAL, 'Search' );
 $template = $title->getFullURL( 'search={searchTerms}' );