[wp-trac] [WordPress Trac] #58234: sanitize_title_with_dashes fatal error when query var value is an array in php 8

WordPress Trac noreply at wordpress.org
Tue Aug 8 15:56:43 UTC 2023


#58234: sanitize_title_with_dashes fatal error when query var value is an array in
php 8
-------------------------------------------------+-------------------------
 Reporter:  mouhdev                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Query                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-unit-tests php80     |     Focuses:
  reporter-feedback                              |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  has-patch needs-unit-tests php80 => has-patch needs-unit-tests
     php80 reporter-feedback


Comment:

 Hello @mouhdev,

 Welcome to WordPress Core's Trac!

 I'm curious about the example code:
 {{{
 <form method="post" action="">
 <input type="text" name="custom_post_type['post_title']" value="This is a
 test post">
 <input type="submit" value="Send">
 </form>
 }}}

 What is the purpose of the form? `'post_title'` is not a valid label or
 arg for a custom post type
 ([https://developer.wordpress.org/reference/functions/register_post_type/
 see developer docs]). I'm confused about the scenario where a form's input
 would have a `'name'` in the form of a custom post type's `'post_title'`.

 I'm asking to understand the real world scenario of the example to
 evaluate if something should happen to catch and process the form input as
 an array before the `WP_Query` code in question.

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


More information about the wp-trac mailing list