[wp-trac] [WordPress Trac] #65123: Having a malformed post type query in $_GET or $_POST yields a critical error

WordPress Trac noreply at wordpress.org
Sun May 3 19:30:33 UTC 2026


#65123: Having a malformed post type query in $_GET or $_POST yields a critical
error
--------------------------------------+---------------------
 Reporter:  hheuzebrutc               |       Owner:  (none)
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  7.1
Component:  Permalinks                |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by yusufmudagal):

 Tested PR https://github.com/WordPress/wordpress-develop/pull/11650

 Before the patch, passing a non-scalar `attachment` value to
 `WP_Query::parse_query()` set `is_attachment` and `is_single`, and
 constructing a custom post type query with an array query var triggered a
 fatal error in `sanitize_title_for_query()`.
 After the patch, `attachment` is normalized to an empty string, both flags
 remain false, and the custom post type query completes without a fatal
 error.

 Patch tests well for me.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/65123#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list