Page MenuHomePhabricator

If the input for the redirect in the meta dialog is invalid, as well as show a red outline, block the user from closing the dialog with a prompt to fix it
Closed, ResolvedPublic1 Estimated Story Points

Description

This task is about VisualEditor. See its user guide for general information.

In the VisualEditor, click the ≡ icon, click "Options", and choose "Page Settings".
If someone puts an invalid page name / page title in the "Target page for redirection" field (like the page name "Talk:" or a page name with a pipe character | in it), and tries to apply the changes, an exception is caused and the editor is locked up.

The "Apply Changes" button should be disabled when the input is not valid (like in e.g. the "Insert ➙ Media" dialog when file dimensions are invalid).

You are expected to provide a patch in Wikimedia Gerrit. See https://www.mediawiki.org/wiki/Gerrit/Tutorial for how to set up Git and Gerrit.

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:46 AM
bzimport set Reference to bz72971.
Catrope created this task.Nov 4 2014, 8:24 PM
#REDIRECT [[MediaWiki:Badtitletext]]

I was testing with characters like <>, pipes, etc.

#REDIRECT [[Talk:]]

comes up for "Talk:", but gets rendered as a numbered list element with a broken link by the MW parser.

So I looked into the code - MWTitleInputWidget (used for redirects and templates) vs. MWLinkTargetInputWidget (links)
I think a lot of the request/response handling code in MWLinkTargetInputWidget should probably be shared, it shows a lot of things in the result like title validity ('legality'), existence of the exact query, external links, exact matches, etc.

Right now it shows the red outline around the textbox when you try to do this. Do we want to block it from saving somehow? Show a warning and automatically set it back to the previous value?

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 27 2015, 10:23 PM

Right now it shows the red outline around the textbox when you try to do this. Do we want to block it from saving somehow? Show a warning and automatically set it back to the previous value?

Sounds good.

Jdforrester-WMF renamed this task from VisualEditor: Handle invalid input for redirect title in meta dialog to If the input for the redirect in the meta dialog is invalid, as well as show a red outline block the user from closing the dialog with a prompt to fix it.Sep 15 2015, 7:25 PM
Jdforrester-WMF triaged this task as Low priority.
Jdforrester-WMF set Security to None.
Jdforrester-WMF edited a custom field.
Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.
Krenair renamed this task from If the input for the redirect in the meta dialog is invalid, as well as show a red outline block the user from closing the dialog with a prompt to fix it to If the input for the redirect in the meta dialog is invalid, as well as show a red outline, block the user from closing the dialog with a prompt to fix it.Sep 15 2015, 7:54 PM

This is still a problem. Typing in an invalid page title (e.g. "A<B") and trying to apply the changes causes an exception and locks up the editor. The button should be disabled when the inputs are not valid (like in e.g. the media dialog when file dimensions are invalid).

I would like to mentor this task in Google-Code-in-2018.

matmarex updated the task description. (Show Details)Oct 23 2018, 4:08 PM

Change 470914 had a related patch set uploaded (by Flutterish; owner: Flutterish):
[mediawiki/extensions/VisualEditor@master] Blocked apply if redirect address is invalid

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

Change 470914 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Blocked apply if redirect address is invalid

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

matmarex closed this task as Resolved.Nov 1 2018, 10:24 PM
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptNov 1 2018, 10:24 PM
Elitre removed a subscriber: Elitre.Nov 8 2018, 4:59 PM