[wp-trac] [WordPress Trac] #56503: PHP error on get_search_form()

WordPress Trac noreply at wordpress.org
Fri Sep 2 17:25:52 UTC 2022


#56503: PHP error on get_search_form()
-----------------------------------------+------------------------------
 Reporter:  seansmyth                    |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  General                      |     Version:  trunk
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:  has-patch => has-patch reporter-feedback


Comment:

 Hi there, welcome to WordPress Trac! Thanks for the ticket and the patch!

 At first I thought that while `echo` is [source:tags/6.0/src/wp-includes
 /general-template.php?marks=270#L267 one of the default arguments] for
 `get_search_form()`, some plugin or theme could unintentionally remove it
 via the `search_form_args`, but it looks like the function already
 protects against that, see [49355] / #51645:
 {{{
 // Ensure that the filtered arguments contain all required default values.
 $args = array_merge( $defaults, $args );
 }}}

 Looking at the error:
 {{{
 Warning: Undefined array key "echo" in .../wp-includes/general-
 template.php on line 363
 }}}
 it is worth noting that in WordPress 6.0.2, the `if ( $args['echo'] )`
 conditional in question is [source:tags/6.0.2/src/wp-includes/general-
 template.php?marks=357#L351 line 357], not 363.

 So I think the following would be helpful to move the ticket forward:
 * Could you share the steps to reproduce the issue on a clean install?
 * What is the version of WordPress you're using?

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


More information about the wp-trac mailing list