Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#50563 closed defect (bug) (duplicate)

Customize: backslash at end of site title affects Customizer loading

Reported by: joyously's profile joyously Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Customize Keywords:
Focuses: Cc:

Description

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/

Change History (1)

#1 @dlh
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version 5.4.2 deleted

Duplicate of #49666.

Note: See TracTickets for help on using tickets.