Last modified: 2011-10-28 01:40:23 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 T18677, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16677 - Media: view URLs should HTTP-redirect to canonical File: namespace
Media: view URLs should HTTP-redirect to canonical File: namespace
Status: NEW
Product: MediaWiki
Classification: Unclassified
File management (Other open bugs)
unspecified
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Media:No...
:
Depends on: 28602
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-16 19:31 UTC by Brion Vibber
Modified: 2011-10-28 01:40 UTC (History)
5 users (show)

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


Attachments
MWException on Media:-titles with a specified action (3.01 KB, text/plain)
2011-10-09 23:07 UTC, Krinkle
Details

Description Brion Vibber 2008-12-16 19:31:23 UTC
A direct view URL which uses the 'Media:' special namespace currently brings up the Image:/File: page transparently, however it doesn't redirect you to the canonical URL, the way that using a non-canonical form of the Image/File namespace does.

To ensure links are pointed sensibly, an HTTP redirect should be issued here.

eg:

http://en.wikipedia.org/wiki/Media:Northern_Spotted_Owl.USFWS-thumb.jpg

->

http://en.wikipedia.org/wiki/File:Northern_Spotted_Owl.USFWS-thumb.jpg
Comment 1 Aaron Schulz 2008-12-23 21:05:46 UTC
Done in r44972
Comment 2 Brion Vibber 2008-12-23 21:57:57 UTC
r44972 isn't quite behaving transparently; non-view URLs are also being redirected to the raw view page, so for instance an ?action=edit or diff or whatever gets lost.

See for example:
http://en.wikipedia.org/wiki/Image:Wiki.png?action=edit
http://en.wikipedia.org/wiki/Media:Wiki.png?action=edit

these both currently behave just like:
http://en.wikipedia.org/wiki/File:Wiki.png?action=edit

while with this patch the Media: one would unexpectedly redirect to the view URL.

The redirection should probably just be done where other existing normalization is... perhaps all that's actually needed is just to replace a Media: Title with the equivalent File: one when initializing the title in the first place, and the existing normalization-redirection will take care of it.

Rolling it back for now in r44981.
Comment 3 Krinkle 2011-10-09 23:06:55 UTC
(In reply to comment #2)
> r44972 isn't quite behaving transparently; non-view URLs are also being
> redirected to the raw view page, so for instance an ?action=edit or diff or
> whatever gets lost.
> 
> See for example:
> http://en.wikipedia.org/wiki/Image:Wiki.png?action=edit
> http://en.wikipedia.org/wiki/Media:Wiki.png?action=edit
> 
> these both currently behave just like:
> http://en.wikipedia.org/wiki/File:Wiki.png?action=edit
> 
> while with this patch the Media: one would unexpectedly redirect to the view
> URL.
> 
> The redirection should probably just be done where other existing normalization
> is... perhaps all that's actually needed is just to replace a Media: Title with
> the equivalent File: one when initializing the title in the first place, and
> the existing normalization-redirection will take care of it.
> 
> Rolling it back for now in r44981.

Probably not related to those two revs, but currently that NS_MEDIA link is shining in it's full glory as a MWException:

http://en.wikipedia.org/wiki/Media:Wiki.png?action=edit

MediaWiki internal error.

Original exception: exception 'MWException' with message 'MWNamespace::getTalk does not make any sense for given namespace -2' in /usr/local/apache/common-local/php-1.18/includes/Namespace.php:40
Stack trace: (See attachment)
Comment 4 Krinkle 2011-10-09 23:07:35 UTC
Created attachment 9203 [details]
MWException on Media:-titles with a specified action
Comment 5 Krinkle 2011-10-09 23:10:06 UTC
New in 1.18 afaik.

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


Navigation
Links