Page MenuHomePhabricator

Add image - caption can be published blank by entering white spaces
Closed, ResolvedPublicBUG REPORT

Description

(1) The easiest way to reproduce:
Type five white spaces in a caption - the Submit button becomes active and the empty caption can be submitted

(2)

  • In add image caption type letters for a valid input - 5 characters or more, e.g. testing. The Submit button becomes active.
  • Then add some trailing white spaces.
  • After entering white spaces, delete the valid input - delete testing word - the Submit button remains active and the caption will be published as it is - with white spaces, i.e. it's blank.

Event Timeline

Etonkovidova renamed this task from Add image -caption can be published blank by entering white spaces to Add image - caption can be published blank by entering white spaces .Dec 2 2021, 9:10 PM
Etonkovidova updated the task description. (Show Details)
mewoph moved this task from Incoming to In Progress on the Growth-Team (Current Sprint) board.

We're only checking the length of the string for validation. We should also check the length when trailing whitespaces are trimmed.

Change 743265 had a related patch set uploaded (by MewOphaswongse; author: MewOphaswongse):

[mediawiki/extensions/GrowthExperiments@master] Add an image: Prevent empty caption from being saved

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

Change 743265 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add an image: Prevent empty caption from being saved

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