Last modified: 2013-04-17 22:38:11 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T46776, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44776 - wgFileExtensions should always be a numerical array without gaps
wgFileExtensions should always be a numerical array without gaps
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.20.x
All All
: High normal (vote)
: 1.21.0 release
Assigned To: Lee Worden
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-08 03:08 UTC by Lee Worden
Modified: 2013-04-17 22:38 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch for UploadWizard.config.php (501 bytes, patch)
2013-02-08 03:14 UTC, Lee Worden
Details

Description Lee Worden 2013-02-08 03:08:27 UTC
This is a pathological case, but causes cryptic, poorly reported failure.  If $wgFileExtensions contains a value in common with $wgFileBlacklist, UploadWizard refuses to upload files of any type.

This happens because Setup.php executes

$wgFileExtensions = array_diff ( $wgFileExtensions, $wgFileBlacklist );

and this creates an array with missing integer keys.  This array is encoded for JavaScript by the Xml class as an Object rather than an Array, and the call to $j.inArray() that UploadWizard uses then fails on all files submitted.

To fix this, either Setup.php should use array_values( array_diff( ... ) ), or else UploadWizard.config.php should say

   'fileExtensions' =>  array_values($wgFileExtensions),
Comment 1 Lee Worden 2013-02-08 03:14:48 UTC
Created attachment 11753 [details]
patch for UploadWizard.config.php
Comment 2 Nischay Nahata 2013-02-08 04:27:33 UTC
Thanks for the patch, you may also be interested in getting developer access[1] so you can get direct code review. Would you like to do that for this patch itself?

[1]http://www.mediawiki.org/wiki/Developer_access
Comment 3 Lee Worden 2013-02-08 04:43:13 UTC
OK, but I don't know the protocol.  Feel free to email me with instructions.
Comment 4 Nischay Nahata 2013-02-08 05:07:18 UTC
You will learn that mostly in the account creation process. Besides you might find http://www.mediawiki.org/wiki/Git/Workflow helpful.
Comment 5 Lee Worden 2013-02-08 07:17:19 UTC
OK.  I did something that might be the right thing.  https://gerrit.wikimedia.org/r/#/c/48092/
Comment 6 Nischay Nahata 2013-02-08 08:32:24 UTC
(In reply to comment #5)
> OK.  I did something that might be the right thing. 
> https://gerrit.wikimedia.org/r/#/c/48092/

That's the fastest someone has been with gerrit :)
Comment 7 Lee Worden 2013-02-08 19:36:35 UTC
2 hours to add bureaucracy to a 1-word patch is the fastest ever?  Seems like a concern.  Anyway, thanks for accepting the report and calling out for reviewers.
Comment 8 Lee Worden 2013-02-24 07:20:46 UTC
https://gerrit.wikimedia.org/r/#/c/50598/ now submitted, in response to comments on gerrit.  This one adds array_values( ) to Setup.php, rather than to UploadWizard.config.php.
Comment 9 Lee Worden 2013-02-24 07:53:46 UTC
context for this bug report is at https://sourceforge.net/p/workingwiki/bugs/259 btw, though it's not necessary
Comment 10 Nischay Nahata 2013-02-27 19:45:27 UTC
Can we consider this fixed? and if so maybe abandon https://gerrit.wikimedia.org/r/#/c/48092/
Comment 11 Jesús Martínez Novo (Ciencia Al Poder) 2013-02-27 19:56:24 UTC
Resolving since Gerrit change #50598 is now merged. In case it isn't solved yet, please reopen.
Comment 12 Gerrit Notification Bot 2013-04-17 22:38:11 UTC
https://gerrit.wikimedia.org/r/48092 (Gerrit Change I46ff25baee72baafe0ff38d3e77fcb6a26f50090) | change ABANDONED [by Worden.lee]

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links