From: gilles Date: Wed, 15 Jan 2014 16:08:19 +0000 (+0100) Subject: Propagate the favicon information to getInfo() X-Git-Tag: 1.31.0-rc.0~17067^2 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=aae0344ce0c1eb9c85f65f4f978fa14c56e092c0;p=lhc%2Fweb%2Fwiklou.git Propagate the favicon information to getInfo() This is needed by MultimediaViewer to show a relevant icon next to the foreign repo link to the description page Change-Id: Id02743b036a2b88677d76613a73787874f5e448b Mingle: Multimedia card #107 --- diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index dc76a2d2ff..2e0bbfda5e 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -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; @@ -254,7 +258,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 ) ); diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 8906834cac..8ae53de066 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -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;