Merge "Propagate the favicon information to getInfo()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 30 Jan 2014 20:44:49 +0000 (20:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 30 Jan 2014 20:44:49 +0000 (20:44 +0000)
includes/api/ApiQuerySiteinfo.php
includes/filerepo/ForeignAPIRepo.php

index a81a520..07561ca 100644 (file)
@@ -124,7 +124,11 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                $data['mainpage'] = $mainPage->getPrefixedText();
                $data['base'] = wfExpandUrl( $mainPage->getFullURL(), PROTO_CURRENT );
                $data['sitename'] = $GLOBALS['wgSitename'];
-               $data['logo'] = $GLOBALS['wgLogo'];
+
+               // wgLogo can either be a relative or an absolute path
+               // make sure we always return an absolute path
+               $data['logo'] = wfExpandUrl( $GLOBALS['wgLogo'], PROTO_RELATIVE );
+
                $data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}";
                $data['phpversion'] = phpversion();
                $data['phpsapi'] = PHP_SAPI;
@@ -250,7 +254,9 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                }
 
                if ( !empty( $GLOBALS['wgFavicon'] ) ) {
-                       $data['favicon'] = $GLOBALS['wgFavicon'];
+                       // wgFavicon can either be a relative or an absolute path
+                       // make sure we always return an absolute path
+                       $data['favicon'] = wfExpandUrl( $GLOBALS['wgFavicon'], PROTO_RELATIVE );
                }
 
                wfRunHooks( 'APIQuerySiteInfoGeneralInfo', array( $this, &$data ) );
index 8906834..8ae53de 100644 (file)
@@ -485,6 +485,10 @@ class ForeignAPIRepo extends FileRepo {
 
                        $info['articlepath'] = $general['articlepath'];
                        $info['server'] = $general['server'];
+
+                       if ( isset( $general['favicon'] ) ) {
+                               $info['favicon'] = $general['favicon'];
+                       }
                }
 
                return $info;