From: Lee Worden Date: Sun, 24 Feb 2013 07:15:11 +0000 (-0800) Subject: Remove gaps from $wgFileExtensions array X-Git-Tag: 1.31.0-rc.0~20587^2 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=6881e5f3657ff40532499a07ec608fc18f6ff3a0;p=lhc%2Fweb%2Fwiklou.git Remove gaps from $wgFileExtensions array If $wgFileExtensions contains values that are in $wgFileBlacklist, when Setup.php uses array_diff to remove them it leaves $wgFileExtensions as an array with nonconsecutive integer indices. When this array is encoded by the Xml class, for use in client-side JavaScript, the nonconsecutive indices cause it to encode it as an Object rather than Array. This breaks the extension processing in UploadWizard's JS code. To fix this, use array_values to remove the gaps in indices. Bug: 44776 Change-Id: I4ef7f1de90a0384800722839f3fa3a581c63bac9 --- diff --git a/includes/Setup.php b/includes/Setup.php index 7f4d6342e9..0853df124f 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -337,7 +337,7 @@ if ( !$wgHtml5Version && $wgHtml5 && $wgAllowRdfaAttributes ) { } # Blacklisted file extensions shouldn't appear on the "allowed" list -$wgFileExtensions = array_diff ( $wgFileExtensions, $wgFileBlacklist ); +$wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) ); if ( $wgArticleCountMethod === null ) { $wgArticleCountMethod = $wgUseCommaCount ? 'comma' : 'link';