[wp-trac] [WordPress Trac] #50563: Customize: backslash at end of site title affects Customizer loading

WordPress Trac noreply at wordpress.org
Sun Jul 5 17:59:45 UTC 2020


#50563: Customize: backslash at end of site title affects Customizer loading
--------------------------+-----------------------------
 Reporter:  joyously      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  5.4.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The problem is a partial loading of Customizer due to a syntax error in
 the `wp.template`, which only happens during load of Customizer.
 To reproduce the problem
 1. Go to Settings > General and enter a single backslash as the last
 character of the site title
 2. Save settings
 3. Go to Appearance > Customize and see that the Customizer is stuck, not
 loading fully.

 The error in the Javascript console is
 {{{
 Uncaught SyntaxError: '' string literal contains an unescaped line break
  wp-includes/js/wp-util.js?ver=5.4.2:39
 }}}

 If you try the backslash anywhere else in the site title, it works fine.
 If you put two backslashes at the end of the site title, it works fine.
 (and both are shown)
 If you change the site title from within Customizer, the problem doesn't
 appear until the next time you load the Customizer.

 I tried the site description field also, but did not see the problem.
 Since the backslash is output correctly on the front end and in the
 Customizer, it seems that escaping is not the problem. I'm thinking that
 the `wp.template` code needs a `try/catch` block in addition to
 scrutinizing the regex used in the template function for this special
 case.

 Original report is: https://wordpress.org/support/topic/customize-broken/

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


More information about the wp-trac mailing list