Cscott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/73199


Change subject: Export information about external image settings via siteinfo 
API.
......................................................................

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
---
M includes/api/ApiQuerySiteinfo.php
1 file changed, 19 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/99/73199/1

diff --git a/includes/api/ApiQuerySiteinfo.php 
b/includes/api/ApiQuerySiteinfo.php
index 09a0f3d..7e2528c 100644
--- a/includes/api/ApiQuerySiteinfo.php
+++ b/includes/api/ApiQuerySiteinfo.php
@@ -129,6 +129,25 @@
                $data['dbtype'] = $GLOBALS['wgDBtype'];
                $data['dbversion'] = $this->getDB()->getServerVersion();
 
+               $allowfrom = array();
+               $allowexception = true;
+               if ( !$GLOBALS['wgAllowExternalImages'] ) {
+                       if ( $GLOBALS['wgEnableImageWhitelist'] ) {
+                               $data['imagewhitelist'] = '';
+                       }
+                       $allowfrom = $GLOBALS['wgAllowExternalImagesFrom'];
+                       $allowexception = !empty( $allowfrom );
+                       if ( !is_array( $allowfrom ) ) {
+                               $allowfrom = array( $allowfrom );
+                       }
+               }
+               if ( $allowexception ) {
+                       $data['externalimages'] = $allowfrom;
+                       $this->getResult()->setIndexedTagName( 
$data['externalimages'],
+                                                                               
                   'allow' );
+               }
+
+
                if ( !$wgDisableLangConversion ) {
                        $data['langconversion'] = '';
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/73199
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I17aae9512e0994222785c5edc9de644685b2498c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to