Page MenuHomePhabricator

Leading whitespace causes articles not to be recognized as redirects
Closed, ResolvedPublic

Description

Author: jlerner

Description:
Trivial patch to Title.php

Sometimes users inadvertently put some whitespace at the beginning of an article that is intended to be a redirect. This results in the article not being classified as a redirect in the database (page.page_is_redirect).

Reproduce by creating a redirect article with some whitespace (newline or otherwise) at the beginning. Then notice that the new article appears in Special:Uncategorizedpages (where redirects normally don't appear). Or just look at the database to see that page.page_is_redirect = 0.

Solution: trim() $text at the beginning of Title::newFromRedirect().

Trivial patch attached.


Version: 1.13.x
Severity: minor

Attached:

Details

Reference
bz13344

Event Timeline

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