Page MenuHomePhabricator

"Media:" namespace URLs should redirect to canonical "File:" namespace
Closed, ResolvedPublic

Description

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


Version: unspecified
Severity: minor
URL: http://en.wikipedia.org/wiki/Media:Northern_Spotted_Owl.USFWS-thumb.jpg

Details

Reference
bz16677

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:29 PM
bzimport set Reference to bz16677.
bzimport added a subscriber: Unknown Object (MLST).

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.

(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)

Created attachment 9203
MWException on Media:-titles with a specified action

Attached:

Krinkle renamed this task from Media: view URLs should HTTP-redirect to canonical File: namespace to "Media:" namespace URLs should redirect to canonical "File:" namespace.Jun 18 2015, 12:59 AM
Krinkle closed this task as Resolved.
Krinkle added a project: MediaWiki-Redirects.
Krinkle set Security to None.
Krinkle removed a subscriber: wikibugs-l-list.