From 3608ba2a349be4403ce973abf86cd9c230c62949 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Thu, 11 Jul 2013 13:56:35 -0400 Subject: [PATCH] Export information about external image settings via siteinfo API. This configuration information is needed in order for Parsoid to appropriately parse external image URLs. Bug: 51092 Change-Id: I17aae9512e0994222785c5edc9de644685b2498c --- includes/api/ApiQuerySiteinfo.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 09a0f3d0be..eb4569f59e 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -129,6 +129,21 @@ class ApiQuerySiteinfo extends ApiQueryBase { $data['dbtype'] = $GLOBALS['wgDBtype']; $data['dbversion'] = $this->getDB()->getServerVersion(); + $allowFrom = array( '' ); + $allowException = true; + if ( !$GLOBALS['wgAllowExternalImages'] ) { + if ( $GLOBALS['wgEnableImageWhitelist'] ) { + $data['imagewhitelistenabled'] = ''; + } + $allowFrom = $GLOBALS['wgAllowExternalImagesFrom']; + $allowException = !empty( $allowFrom ); + } + if ( $allowException ) { + $data['externalimages'] = (array) $allowFrom; + $this->getResult()->setIndexedTagName( $data['externalimages'], 'prefix' ); + } + + if ( !$wgDisableLangConversion ) { $data['langconversion'] = ''; } -- 2.20.1