Opened 4 years ago
Closed 4 years ago
#51645 closed defect (bug) (fixed)
Undefined index: echo in core files
Reported by: | kellybleck | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.5.2 | Priority: | normal |
Severity: | trivial | Version: | 5.2 |
Component: | General | Keywords: | has-patch fixed-major |
Focuses: | template | Cc: |
Description
Updated to WordPress 5.5.1, and have my WP_DEBUG set to output to an error file. There is one that crops up all the time -
[22-Sep-2020 03:39:44 UTC] PHP Notice: Undefined index: echo in /var/www/httpdocs/wp-includes/general-template.php on line 350
Attachments (1)
Change History (10)
#3
@
4 years ago
- Keywords has-patch dev-feedback added
- Milestone changed from Awaiting Review to 5.5.2
#5
@
4 years ago
I think a better fix here would be to ensure that all the default values are always set:
$args = wp_parse_args( $args, apply_filters( 'search_form_args', $defaults ) );
That way we don't have to check whether each individual argument exists.
The same approach is used in comment_form()
, wp_login_form()
, and register_sidebar()
.
#6
@
4 years ago
On second thought, that does not fix the issue and changes the behavior of the filter to no longer receive custom values. Taking another look.
Note: See
TracTickets for help on using
tickets.
Welcome to Trac, @kellybleck! This does indeed look like something that should be investigated.
In 5.2, the
$args
parameter was added and made filterable with thesearch_form_args
filter. It looks like the filtered$args
could unset theecho
property and throw this notice whenif ( $args['echo'] ) {
is run.My guess is that a simple
isset
sanity check would work here.