Page MenuHomePhabricator

Page Forms JavaScript hangs forever, if free text contains unbalanced double brackets followed by a pipe character
Closed, ResolvedPublicBUG REPORT

Description

To reproduce, enter Some text [[Some page|Alias more text in a form's free text field and submit.

JavaScript will hang at the loop starting at line 797 in libs/PageForms.js.

When nextDoubleBracketsEnd are set to -1, and then curIndex = nextDoubleBracketsEnd + 2, i.e., 1, the loop becomes endless.

It seems that the check if ( nextDoubleBracketsEnd < 0 ) should be placed elsewhere, or the whole check for pipes not inside double square brackets rewritten.

Event Timeline

Change 952298 had a related patch set uploaded (by Alex Mashin; author: mashin):

[mediawiki/extensions/PageForms@master] Fix (hopefully) the free pipe check

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

Change 952298 merged by jenkins-bot:

[mediawiki/extensions/PageForms@master] Fix (hopefully) the free pipe check

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

alex-mashin claimed this task.