Skip to content
Permalink
Browse files

Accessibility: In back-compat code added for `get_search_form()` in […

…44956], when checking the (previously boolean) `$args` value, account for non-strict comparison.

Props dkarfa, sachyya-sachet.
Merges [45340] to the 5.2 branch.
Fixes #47177. See #42057.

git-svn-id: https://develop.svn.wordpress.org/branches/5.2@45341 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed May 17, 2019
1 parent 2e19fe4 commit 7a5aab3e11b6520b58e54f87d28b341bccc81412
Showing with 9 additions and 10 deletions.
  1. +9 −10 src/wp-includes/general-template.php
@@ -209,19 +209,16 @@ function get_search_form( $args = array() ) {
*/
do_action( 'pre_get_search_form' );
$format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml';
/*
* Back compat: to ensure previous uses of get_search_form continue to
* function as expected, we handle a value for the boolean $echo param removed
* in 5.2.0. Then we deal with the $args array and cast its defaults.
*/
$echo = true;
if ( false === $args ) {
$echo = false;
}
if ( ! is_array( $args ) ) {
/*
* Back compat: to ensure previous uses of get_search_form() continue to
* function as expected, we handle a value for the boolean $echo param removed
* in 5.2.0. Then we deal with the $args array and cast its defaults.
*/
$echo = (bool) $args;
// Set an empty array and allow default arguments to take over.
$args = array();
}
@@ -243,6 +240,8 @@ function get_search_form( $args = array() ) {
*/
$args = apply_filters( 'search_form_args', $args );
$format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml';
/**
* Filters the HTML format of the search form.
*

0 comments on commit 7a5aab3

Please sign in to comment.
You can’t perform that action at this time.