Make WordPress Core

Opened 2 years ago

Last modified 5 months ago

#60427 assigned defect (bug)

small "ü" in page as anchor causes a mistake when try to save (wrong JSON-response)

Reported by: gregordoehnert's profile gregordoehnert Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 6.4.3
Component: Posts, Post Types Keywords: needs-patch
Focuses: ui, administration Cc:

Description

I tried to make some changes on a page with pre-block content. It contains some anchors and everytime I tried to save the page after some small changes I got the alert "Aktualisierung fehlgeschlagen. Die Antwort ist keine gültige JSON-Antwort.". The well know answer that there is something wrong with JSON.
I found the reason is that in the anchors where small "ü" (a german umlaut). It happened with the anchor target as well as with the anchor link. And at the same time there are some anchors with other umlauts, namely with a big "Ü", which do not cause the issue.

Attachments (1)

anchor-test.gif (1.3 MB) - added by lakshyajeet 6 months ago.

Download all attachments as: .zip

Change History (4)

#1 @lakshyajeet
6 months ago

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.9-alpha-60272
  • PHP: 8.2.28
  • Server: Apache/2.4.62 (Debian)
  • Database: mysqli (Server: 11.4.7-MariaDB-ubu2404 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 138.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.2
  • MU Plugins:
  • Plugins:
    • Gutenberg 21.3.0-rc.1
    • Test Reports 1.2.0

Reproduction Steps

  1. Navigate to Posts -> Add Post.
  2. Insert any block and set its HTML Anchor to ü
  3. Insert a Custom HTML block and add the following content.
    <a href="#ü">Test123</a>
    
  4. Click Publish or Save to save the post.
  5. Observe whether a JSON error appears.

Actual Results

  1. ❌ Issue not reproduced.
  2. ✅ Page saved successfully without errors.
  3. ✅ Anchor tags with lowercase ü rendered correctly in the editor and front-end.

Additional Notes

No browser console errors or network request failures observed.

#2 @debarghyabanerjee
5 months ago

Hi @gregordoehnert, Thanks for reporting the issue. However, I tried reproducing the issue, but was unable to reproduce it. Could you give some more insights on what plugins and theme you are using. Thank You.

#3 @knutsp
5 months ago

May this be caused by the database charset(s) not being set to proper value? utf8mb4 is recommended.

Note: See TracTickets for help on using tickets.