Last modified: 2011-10-19 19:26:39 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 T33812, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31812 - Broken "use this file" link in Commons for media with a ? in the file name
Broken "use this file" link in Commons for media with a ? in the file name
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-19 00:09 UTC by Dario Taraborelli
Modified: 2011-10-19 19:26 UTC (History)
3 users (show)

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


Attachments

Description Dario Taraborelli 2011-10-19 00:09:00 UTC
Click on the "use this file" link for this page on Commons:

https://commons.wikimedia.org/w/index.php?title=File:New_Editors_Not_Welcome%3F_When_Wikipedia_articles_trend.pdf&page=1

The question mark in the file name is not urlencoded, which generates a broken link for Page URL:

https://commons.wikimedia.org/wiki/File:New_Editors_Not_Welcome?_When_Wikipedia_articles_trend.pdf

The link should be:

https://commons.wikimedia.org/wiki/File:New_Editors_Not_Welcome%3F_When_Wikipedia_articles_trend.pdf
Comment 1 Brion Vibber 2011-10-19 18:17:24 UTC
It's also not expanding the protocol-relative links, which likely breaks uses in some tools.
Comment 2 Brion Vibber 2011-10-19 18:28:58 UTC
The ? bit is probably from use of encodeURI() instead of encodeURIComponent:

https://commons.wikimedia.org/wiki/MediaWiki:Stockphoto.js

			this.backlink_url = location.protocol + "//commons.wikimedia.org/wiki/" + encodeURI(wgPageName); 


After a forced refresh I can see an 'https:' in there (the location.protocol + ... bit) which was added October 13... may indicate some caching bugs (or just that it's still not being loaded ideally through RL).
Comment 3 Brion Vibber 2011-10-19 18:31:49 UTC
Added a change req on script talk page using {{editprotected}} tpl:
https://commons.wikimedia.org/wiki/MediaWiki_talk:Stockphoto.js#Escaping_fix_in_URLs
Comment 4 Saibo 2011-10-19 19:19:41 UTC
Should be fixed. Tested it.
Comment 5 Brion Vibber 2011-10-19 19:26:39 UTC
Confirmed works after forcing a refresh here -- thanks!

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


Navigation
Links