Page MenuHomePhabricator

Spaces before [[Category:]] link are ignored
Open, LowPublic

Description

Two-character fix

Parser.php contains a strange construct (line 1703):
$s = rtrim($s . "\n");

I would guess the added newline is just a waste of time/memory, since it gets trimmed again immediately. I believe the original author (see r8309) intended to write a comma instead of a dot.

And indeed, the line should IMHO read
$s = rtrim($s, "\n");
because at the current version, spaces before category links are ignored, so that wikitext like “Lorem [[Category:Foo]]ipsum]]” ends up showing “Loremipsum”, not “Lorem ipsum” one might expect (see the attached URL).

Not that it would be any major bug ;-)


Version: 1.21.x
Severity: trivial
URL: http://test.wikipedia.org/wiki/Typo_in_rtrim

Attached:

Details

Reference
bz17988

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:33 PM
bzimport set Reference to bz17988.
bzimport added a subscriber: Unknown Object (MLST).
demon added a comment.Mar 16 2009, 2:34 PM

Cf bug 16882

karun.84 wrote:

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

  • Bug 8381 has been marked as a duplicate of this bug. ***
IAlex added a comment.Jul 27 2009, 7:43 PM

fixed in r53832.

This caused some pages to go entirely blank... reverted in r56472.

Example self-contained test case (not totally minimized) at http://test.wikipedia.org/wiki/Bug_17988_regression

Update keywords (-/- easy, reviewed, +need-review)

Remove Keyword patch, it obviously didn't work

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

sumanah wrote:

Added the "reviewed" keyword since Mormegil received a review of the patch. Mormegil, do you know whether the bug is still reproducible?

(In reply to comment #9)

Mormegil, do you know whether the bug is still reproducible?

Yes, it is. The URL linked above http://test.wikipedia.org/wiki/Typo_in_rtrim leads to a simple reproducible testcase, showing that “Lorem [[Category:Foo]]ipsum” renders as “Loremipsum” (with the Foo category added).

sumanah wrote:

Still reproducible in master.

Same for whitespace between two links.

When table is not closed.

See http://ru.wikipedia.org/wiki/User:DonRumata/bug

{|
12345 aaaa [[WBC]] [[WBC]] bbb 12345

aravikn wrote:

Is this bug resolved?

bburette wrote:

(In reply to comment #14)

Is this bug resolved?

Hi,

No the bug has not been corrected, I just tested. It is still present in current en.wikipedia.org MediaWiki, version "MediaWiki 1.23wmf10". See link http://test.wikipedia.org/wiki/Typo_in_rtrim for an example.

Regards,

aravikn wrote:

Thanks Bernard. BTW, Are the changes mentioned in comment 1 sufficient for actually fixing this?

To avoid confusion:

Steps to reproduce:
*Type the text "Lorem [[Category:Foo]]ipsum" into a wiki page (without quotes)
*Hit save.

Expected output is the two words "Lorem ipsum"

Actual output is a single word "Loremipsum"

The space between "Lorem" and the category tag seems to disappear.

Change 108205 had a related patch set uploaded by Arav93:
Put the space before category links to consideration

https://gerrit.wikimedia.org/r/108205

demon removed a subscriber: demon.Aug 23 2015, 4:07 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 23 2015, 4:07 PM
Aklapper removed a project: Parser.Mar 16 2020, 4:42 PM