[wp-trac] [WordPress Trac] #47888: Adding a custom link in menu via Customize doesn't trim whitespace.

WordPress Trac noreply at wordpress.org
Sat Aug 17 10:48:16 UTC 2019


#47888: Adding a custom link in menu via Customize doesn't trim whitespace.
--------------------------+-----------------------------
 Reporter:  donmhico      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Steps to reproduce bug.

 1. Click "Customize" on any front-end page.
 2. Try to add / edit a Menu and add a Custom Link.

 The following behaviour happens.

 A. If the URL has a whitespace in front. e.g. ` https://wp.org/`
     - URL field box will have red border and the custom link won't be
 added.

 B. If the URL has a whitespace in the end. e.g. `https://wp.org/ `
     - Custom link will be added but if the menu will have the link
 `https://wp.org/%20`

 I think it would be best if the URL is trimmed before the checking of URL
 regex happens.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47888>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list