Opened 6 years ago
Closed 6 years ago
#51645 closed defect (bug) (fixed)
Undefined index: echo in core files
| Reported by: | kellybleck | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.5.2 |
| Component: | General | Version: | 5.2 |
| Severity: | trivial | Keywords: | has-patch fixed-major |
| Cc: | Focuses: | template |
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)
#5
@
6 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
@
6 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Welcome to Trac, @kellybleck! This does indeed look like something that should be investigated.
In 5.2, the
$argsparameter was added and made filterable with thesearch_form_argsfilter. It looks like the filtered$argscould unset theechoproperty and throw this notice whenif ( $args['echo'] ) {is run.My guess is that a simple
issetsanity check would work here.