Page MenuHomePhabricator

Special:Upload fails on a space as destination filename
Closed, ResolvedPublic

Description

Steps to reproduce:

Actual result:

  • The spinner does not stop.
  • In the JavaScript console the error TypeError: result.query is undefined occurs.

The API request https://www.mediawiki.org/w/api.php?action=query&format=json&formatversion=2&titles=%20&prop=imageinfo&iiprop=uploadwarning returns

{"batchcomplete":true}

The expected key query is missing in the response.

Details

Related Gerrit Patches:

Event Timeline

Fomafix created this task.Jan 21 2018, 12:22 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 21 2018, 12:22 AM
Fomafix claimed this task.Jan 21 2018, 12:22 AM

Change 405557 had a related patch set uploaded (by Fomafix; owner: Fomafix):
[mediawiki/core@master] mediawiki.special.upload: trim nameToCheck

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

Anomie added a subscriber: Anomie.

The API request https://www.mediawiki.org/w/api.php?action=query&format=json&formatversion=2&titles=%20&prop=imageinfo&iiprop=uploadwarning returns

{"batchcomplete":true}

The expected key query is missing in the response.

The API treats a whitespace-only value for a multi-value parameter the same as an empty value; this behavior was added in rSVN32224. I don't know why it was done that way instead of only treating a zero-length string as empty.

The query key being absent when no titles are supplied also is longstanding API behavior, and is already filed as T33901: API: action=query with empty title set should still respond with "query" element. See that task for further discussion.

The trimming of the title and the missing query key without an error seams both to be very inconsistent.

Change 405557 merged by jenkins-bot:
[mediawiki/core@master] mediawiki.special.upload: trim nameToCheck

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

Umherirrender closed this task as Resolved.Mar 16 2018, 6:04 PM
Umherirrender triaged this task as Medium priority.