Add $wgFavicon to siteinfo API
authorGergő Tisza <tgr.huwiki@gmail.com>
Mon, 13 Jan 2014 11:00:53 +0000 (11:00 +0000)
committerGergő Tisza <tgr.huwiki@gmail.com>
Mon, 13 Jan 2014 11:00:53 +0000 (11:00 +0000)
This would be used by MultimediaViewer to show an icon next to the
link to the description page (and probably makes sense to include
$wgFavicon if $wgLogo is there, anyway).

Bug: 59925
Change-Id: Ibdad9c3d2b515fbfdcd458db9b061f4d4d375180

includes/api/ApiQuerySiteinfo.php

index 0a74d98..dc76a2d 100644 (file)
@@ -253,6 +253,10 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                        $data['imagelimits'][$k] = array( 'width' => $limit[0], 'height' => $limit[1] );
                }
 
+               if ( !empty( $GLOBALS['wgFavicon'] ) ) {
+                       $data['favicon'] = $GLOBALS['wgFavicon'];
+               }
+
                wfRunHooks( 'APIQuerySiteInfoGeneralInfo', array( $this, &$data ) );
 
                return $this->getResult()->addValue( 'query', $property, $data );