Check for existence of iw_local in Interwiki::getAllPrefixes
authorBryan Davis <bd808@wikimedia.org>
Fri, 22 Aug 2014 02:24:25 +0000 (20:24 -0600)
committerBryan Davis <bd808@wikimedia.org>
Fri, 22 Aug 2014 02:24:25 +0000 (20:24 -0600)
Interwiki::getAllPrefixes only sets the iw_local member in a response
row if $local is set to a non-null value. Under certain error
reporting conditions, the unqualified access to the array key leads to
warnings such as "message repeated 1471 times: [ #012Notice: Undefined
index: iw_trans in ...".

Change-Id: Ibf434dc9c362984cad76ae6bdb29de826974d81e

includes/api/ApiQuerySiteinfo.php

index 90683a9..f17ac29 100644 (file)
@@ -393,7 +393,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                        $prefix = $row['iw_prefix'];
                        $val = array();
                        $val['prefix'] = $prefix;
-                       if ( $row['iw_local'] == '1' ) {
+                       if ( isset( $row['iw_local'] ) && $row['iw_local'] == '1' ) {
                                $val['local'] = '';
                        }
                        if ( $row['iw_trans'] == '1' ) {