Page MenuHomePhabricator

Typing consecutive spaces into the iOS section editor converts every other space to a NBSP, which can break templates
Closed, ResolvedPublic

Description

Repro steps

  1. Open https://test.wikipedia.org/wiki/Template
  2. Tap the edit pencil on the first section
  3. Replace the spaces between name and = and cover and = with spaces entered by the iOS keyboard
  4. Submit the edit

Expected

Resulting article has a functioning template

Actual

Resulting article has a broken template

Original report

This edit and this edit (the | victims = parameter), both tagged as "ios app edit", changed regular spaces to non-breaking spaces (NBSP) in similar patterns within template parameter assignments. This breaks the parameter assignments, in this case causing the corresponding items in the infobox to not be displayed, but it can break templates more severely.

These character substitutions, with the pattern of alternating regular spaces and NBSPs, look unlikely to be caused by the person making the edit.

Steps to reproduce

I don't have an iOS device, so I can't reproduce such an edit.

Expected results

Editing should not cause spaces to be changed to NBSPs in template parameter assignments.

Actual results

Spaces were changed to NBSPs in template parameter assignments.

Environments observed

Page revision history, edits with "ios app edit" tags

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 22 2019, 1:45 PM
JoeWalsh triaged this task as Normal priority.Mar 22 2019, 5:41 PM
JoeWalsh updated the task description. (Show Details)Mar 22 2019, 6:45 PM
JoeWalsh moved this task from Doing to Needs Code Review on the iOS-app-v6.2.1-Beluga-On-Stilts board.

@FredTC This is the bug you reported at enwiki's Village pump miscellaneous last week.

Pipetricker added a comment.EditedMar 23 2019, 10:42 AM

@JoeWalsh, a question when you have found the cause of this bug:

Would it be possible for this bug to cause an NBSP that is in a parameter assignment but is not between the parameter name and the =, or is not in a parameter assignment at all?

I think I have encountered this before knowing about the invisible NBSP. I removed a space in Wikivoyage in "lat=" and/or "long=" between the = and the value. After doing this the marker appeared on the map.

Pipetricker updated the task description. (Show Details)Mar 27 2019, 12:55 PM

@Pipetricker this bug causes a NBSP any time the user enters two consecutive spaces, so it isn't limited to parameter assignment or any particular part of wikitext

Pipetricker added a comment.EditedMar 27 2019, 4:18 PM

I suggest changing the title of this bug to "Consecutive spaces changed to NBSPs, which can break templates", or something like that.

JoeWalsh renamed this task from Spaces changed to NBSPs in template parameter assignments, breaking the assignment to iOS section editor converts every other consecutive space entered into NBSPs, which can break templates.Mar 27 2019, 5:31 PM
JoeWalsh renamed this task from iOS section editor converts every other consecutive space entered into NBSPs, which can break templates to iOS section editor converts every other consecutive space typed into NBSPs, which can break templates.
JoeWalsh renamed this task from iOS section editor converts every other consecutive space typed into NBSPs, which can break templates to Typing consecutive spaces into the iOS section editor converts every other space to a NBSP, which can break templates.
Pipetricker updated the task description. (Show Details)Mar 27 2019, 8:56 PM
Pipetricker added a comment.EditedMar 28 2019, 10:41 AM

Just a thought: Could the breaking of templates by misplaced NBSPs be avoided by changing MediaWiki's parameter handling to treat NBSPs like other whitespace characters in assignments?

ABorbaWMF added a subscriber: ABorbaWMF.

Looks good on 6.2.1 (1594)

JMinor closed this task as Resolved.Apr 9 2019, 5:22 PM
JMinor added a subscriber: JMinor.

Thanks for reporting and following up folks. This shipped to the app store on Monday. Download the latest version to see the fix.