[wp-trac] [WordPress Trac] #62287: WP_REST_Posts_Controller::prepare_items_query() - Warning $prepared_args can be null

WordPress Trac noreply at wordpress.org
Mon Feb 23 13:27:55 UTC 2026


#62287: WP_REST_Posts_Controller::prepare_items_query() - Warning $prepared_args
can be null
--------------------------+------------------------------
 Reporter:  apermo        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  REST API      |     Version:  4.7
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Changes (by apermo):

 * version:   => 4.7


Comment:

 - Posts controller (class-wp-rest-posts-controller.php): The vulnerable
 foreach ($prepared_args as ...) pattern was introduced in commit
 4f685410b2 ("REST API: Remove get_allowed_query_vars() now filter is
 gone.") — first released in WordPress 4.7.0.
   - Revisions controller (class-wp-rest-revisions-controller.php):
 Introduced in commit b513113c49 ("REST API: Support pagination, order,
 search and other common query parameters for revisions.") — first released
 in WordPress 5.0.0.

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


More information about the wp-trac mailing list