WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 4 months ago

#52295 new defect (bug)

The response is not a valid JSON response - URL permalink using the ? sign

Reported by: rshlo Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.6
Component: Permalinks Keywords:
Focuses: Cc:

Description

Encountered a problem at a friend's blog so tried to recreate it on a test site.

  1. Installed vanilla WP_5.6-he_IL with no additional settings or changes on shared Dreamhost hosting with default settings - no cache, Cloudflare or any other settings. Server uses php 7.4
  2. Created a first post - everything works great.
  3. Changed the permalink to the simple permalink format e.g. /?=123, that was the default in older versions.
  4. Tried to create a new post with a URL inside the post and got the above mentioned error message.
  5. Changed to other permalink structures - no problem at all.

Change History (2)

#1 @rshlo
5 months ago

checking the debug log points to an error in
wp-includes/load.php:1650
That is a function to

		$cache[ $media_type ] = (bool) preg_match( '/(^|\s|,)application\/([\w!#\$&-\^\.\+]+\+)?json(\+oembed)?($|\s|;|,)/i', $media_type );

So it seems that this regex check is failing on links with the ? sign in the url.

Last edited 4 months ago by sabernhardt (previous) (diff)

#2 @sabernhardt
4 months ago

  • Component changed from General to Permalinks
Note: See TracTickets for help on using tickets.