[wp-trac] [WordPress Trac] #32412: Hitting Enter on the create/edit link dialogue can create dodgy links in some situations

WordPress Trac noreply at wordpress.org
Fri May 15 13:14:10 UTC 2015


#32412: Hitting Enter on the create/edit link dialogue can create dodgy links in
some situations
--------------------------+---------------------------------------------
 Reporter:  andfinally    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  ui, javascript, administration
--------------------------+---------------------------------------------

Comment (by andfinally):

 I suggest the attached patch to deal with this case. I've moved correctURL
 outside of init to be a method of wpLink, and I'm calling it inside
 mceUpdate. Alternatively, it can be called from inside the
 inputs.submit.click handler. There should be no issue with correction
 being applied twice, because the condition comparing the URL with
 correctedURL should stop it. It's good to keep the correction on paste or
 blur so the user is aware of the change that's being applied. This method
 also keeps the behaviour allowing the user to enter a non-protocol address
 if he repeats the entry after it's corrected.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32412#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list