Page MenuHomePhabricator

Parsing links in edit summaries behaves different from regular parser when missing square brackets
Closed, ResolvedPublic

Description

See the diff: due to a bug in AWB, edit summary was with mismatching square brackets:

no 'of' between a month and a year per [[Wikipedia:Manual_of_Style_%28dates_and_numbers%29#Longer_periods|MOS]], added [[:Category:Uncategorized stubs|uncategori using [[Project:AutoWikiBrowser|AWB]]

it resulted in the following edit summary displayed: "no 'of' between a month and a year per MOS, added AWB", where AWB is linked to [[Category:Uncategorised stubs]]. This is completely diferent from how page text parser would handle such input.

Although we're working to fix edit summary trimming code in AWB, MediaWiki should also process summaries correctly.

Details

Reference
bz15745

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:16 PM
bzimport added a project: MediaWiki-Page-Diffs.
bzimport set Reference to bz15745.
bzimport added a subscriber: Unknown Object (MLST).
MaxSem created this task.Sep 27 2008, 9:00 AM
brion added a comment.Jul 20 2009, 4:15 AM

Note that the parser test suite now supports testing the edit-comment mini-parser as well. Add test cases with 'comment' option.

Fixed in r53534 with parser test.

Reverted in r55644, causes http://bugs.php.net/bug.php?id=48501 / bug 19845.

Reedy set Security to None.Mar 7 2015, 7:21 PM
demon removed a subscriber: demon.Aug 23 2015, 4:01 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 23 2015, 4:01 PM
TTO added a subscriber: TTO.Nov 29 2015, 10:28 AM

The patch https://phabricator.wikimedia.org/rSVN53534 was only reverted because it caused crashes in PHP 5.2.6. We no longer support this version, so it might be possible to simply re-apply that patch. The code in question hasn't changed much since 2009.

Reedy added a comment.Nov 29 2015, 1:42 PM
In T17745#1836602, @TTO wrote:

The patch https://phabricator.wikimedia.org/rSVN53534 was only reverted because it caused crashes in PHP 5.2.6. We no longer support this version, so it might be possible to simply re-apply that patch. The code in question hasn't changed much since 2009.

Seems worth trying for starters :)

Reedy added a comment.Nov 30 2015, 8:04 AM
In T17745#1836602, @TTO wrote:

The patch https://phabricator.wikimedia.org/rSVN53534 was only reverted because it caused crashes in PHP 5.2.6. We no longer support this version, so it might be possible to simply re-apply that patch. The code in question hasn't changed much since 2009.

Looks like the Linker code has been refactored a bit... Mostly removing the seperate callback function and bringing it into a closure...

https://github.com/wikimedia/mediawiki/blob/master/includes/Linker.php#L1391-L1494

MGChecker updated the task description. (Show Details)
MGChecker removed a subscriber: wikibugs-l-list.
Krinkle renamed this task from Edit summary link parsing too simplistic to Parsing links in edit summaries behaves different from regular parser when missing square brackets.Feb 9 2019, 8:29 PM
Krinkle edited projects, added MediaWiki-Parser; removed MediaWiki-Comment-backend.
Krinkle closed this task as Resolved.Feb 9 2019, 8:34 PM
Krinkle claimed this task.
Krinkle added a subscriber: Krinkle.

Current rendering for the edit summary of the originally reported diff, is now better than it used to be:

It now no longer ignores the middle chunk between the two pipes, which makes it more obvious that an error has occurred.

Having said that, it is still different from the regular wikitext parser, which as of today, renders as follows:

Given this is only about behaviour in case of invalid syntax, I think we can close this. They were never meant to behave the same for invalid syntax. They do, however, now behave the same for valid syntax, which might be good enough?

Krinkle removed Krinkle as the assignee of this task.Feb 9 2019, 8:34 PM