Page MenuHomePhabricator

Pages beginning with slash sometimes allowed
Closed, ResolvedPublic

Description

Author: timwi

Description:
BUG MIGRATED FROM SOURCEFORGE
http://sourceforge.net/tracker/index.php?func=detail&aid=977535&group_id=34373&atid=411192
Originally submitted by Nobody/Anonymous - nobody 2004-06-22 17:04

For redirect pages that go to a page title that begins
with a '/', when the redirect page is viewed with
&redirect=no, the '/' is not shown in the link and
these redirects are seen as broken by
Special:Maintenance&subfunction=brokenredirects

An example of this is:
http://en.wikipedia.org/w/wiki.phtml?title=Gcwi_language&redirect=no

which displays a link to [[Gwi language]] (which does
not exist) instead of /Gwi language. The redirects
works if &redirect=yes

  • Additional comments ------------------------

Date: 2004-06-22 19:17
Sender: SF user imsop

Actually, the problem is wider than you think: no link can
point at a page beginning with "/". The reason is that in a
namespace where subpages are legal (e.g.
[[Wikipedia:Sandbox]]) it will be treated as a subpage link
(e.g. to [[Wikipedia:Sandbox/Gwi language]]). In Wikipedia's
article namespace, subpages are disabled, so the software
removes the slash as being erroneous.

The bug is that you were able to create a page with such a
title in the first place. (And that the redirect *does*
work, even though the links don't; a consequence of the
rather ad hoc parser, I suspect).

Workaround: move the pages so they don't begin with slashes

  • awkward, I know but they won't be the only ones - see

http://en.wikipedia.org/wiki/Wikipedia:List_of_pages_whose_correc
t_title_is_not_allowed_by_MediaWiki

This bug should stay open until someone blocks such pages

from being created accidentally.

Date: 2004-06-28 04:46
Sender: SF user vibber

This page title should not work under the current schema.
That is does is erroneous, as it can't be reached through
normal links:
http://en.wikipedia.org/wiki//Gwi_language

Renamed bug report to reflect the root problem.


Version: unspecified
Severity: minor

Details

Reference
bz98

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 6:50 PM
bzimport set Reference to bz98.
bzimport added a subscriber: Unknown Object (MLST).

rowan.collins wrote:

*** Bug 116 has been marked as a duplicate of this bug. ***

wmahan_04 wrote:

Hi, my patch at bug 428 should allow articles beginning with slash to be linked
normally, although it only applies when subpages are disabled.

Created attachment 2582
Tested patch that makes any title with / as the first character invalid

Attached:

rotemliss wrote:

Reverted on 17456 by Simetrical, because several pages with this name are
already exist.

robchur wrote:

Don't we have a script to clean up dud titles and rename the pages?

ayg wrote:

Probably, so if anyone would care to run it . . .

Why not fix the linking code, instead of disabling initial slashes? In cases
where there is a conflict with subpage syntax, you can just specify the
namespace, e.g. [[User:/Foo]] or [[:/Foo]].

ayg wrote:

The linking code appears to work fine at present, although if you're in a
namespace with subpages it requires the leading colon. Should either be FIXED
or WONTFIX.

  • Bug 8046 has been marked as a duplicate of this bug. ***

river wrote:

can't reproduce the original behaviour here, presumably it's been fixed at some point.

It is still possible to create a page with a slash as the leading character, e.g., https://en.wikipedia.org/w/index.php?title=/test&action=edit

The created page is then exists at https://en.wikipedia.org/wiki//test and is not possible to be linked with an internal link.

wmahan_04 wrote:

Hi, my patch at bug 428 should allow articles beginning with slash to be linked
normally, although it only applies when subpages are disabled.

Pppery edited projects, added MediaWiki-Redirects; removed MediaWiki-General.
Pppery subscribed.

The original bug here was fixed ages ago. It was later reopened in 2019 due to an unrelated issue, which is IMO not a bug at all and should have a separate ticket if anyone still cares.