Make WordPress Core

Opened 6 months ago

Closed 5 months ago

#61376 closed defect (bug) (reported-upstream)

Site editor template description displays encoded characters

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

Description

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 &

Attachments (1)

template-description.png (41.5 KB) - added by poena 6 months ago.
The template description

Download all attachments as: .zip

Change History (3)

@poena
6 months ago

The template description

#1 @khokansardar
6 months ago

@poena it seems gutenberg editor issue. So, I have created the same as you mentioned in this ticket in gutenberg - https://github.com/WordPress/gutenberg/issues/62335
Also added the PR for it - https://github.com/WordPress/gutenberg/pull/62336

#2 @poena
5 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.