[wp-trac] [WordPress Trac] #61376: Site editor template description displays encoded characters

WordPress Trac noreply at wordpress.org
Wed Jun 5 07:54:41 UTC 2024


#61376: Site editor template description displays encoded characters
--------------------------+-----------------------------
 Reporter:  poena         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In the Site Editor, it is possible to create a custom page template for
 pages that have a combination of text and HTML entities in the title.

 When such a page template is displayed in the Site Editor, it displays the
 page title as part of the template description in the Template panel in
 the Site Editor Sidebar.

 The HTML entities are not decoded, for example, a template for a page
 called
 "Hello World & Hello WP" Would show the description: "Template for Hello
 World & Hello WP"

 For some reason, If the page is only called "&" the description displays
 as "Template for &".

 I have only tested this on 6.6-beta1-58337-src. Further testing is needed
 to determine where the problem was introduced.

 The reason why I created a trac ticket instead of a Gutenberg GitHub issue
 is because the problem seems to be in
 https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes
 /block-template-utils.php#L675


 == Testing Instructions
 These steps define how to reproduce the issue, and indicate the expected
 behavior.

 === Steps to Reproduce
 1. Activate a block theme.
 2. Create a new page with the title "Hello World & Hello WP"
 3. Go to Appearance > Editor > Templates.
 4. Select "Add new template". Select Pages, and then select the page you
 just created.
 5. Open the settings sidebar and the template panel.
 6. The description is in the template panel below the page name, close to
 the top. Check if & displays correctly

 === Expected Results

 - ❌ the character displays as &

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


More information about the wp-trac mailing list