WordPress.org

Make WordPress Core

Changeset 45341


Ignore:
Timestamp:
05/17/2019 02:23:53 AM (3 months ago)
Author:
SergeyBiryukov
Message:

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.

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/src/wp-includes/general-template.php

    r45134 r45341  
    210210    do_action( 'pre_get_search_form' );
    211211
    212     $format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml';
    213 
    214     /*
    215      * Back compat: to ensure previous uses of get_search_form continue to
    216      * function as expected, we handle a value for the boolean $echo param removed
    217      * in 5.2.0. Then we deal with the $args array and cast its defaults.
    218      */
    219212    $echo = true;
    220     if ( false === $args ) {
    221         $echo = false;
    222     }
    223213
    224214    if ( ! is_array( $args ) ) {
     215        /*
     216         * Back compat: to ensure previous uses of get_search_form() continue to
     217         * function as expected, we handle a value for the boolean $echo param removed
     218         * in 5.2.0. Then we deal with the $args array and cast its defaults.
     219         */
     220        $echo = (bool) $args;
     221
    225222        // Set an empty array and allow default arguments to take over.
    226223        $args = array();
     
    243240     */
    244241    $args = apply_filters( 'search_form_args', $args );
     242
     243    $format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml';
    245244
    246245    /**
Note: See TracChangeset for help on using the changeset viewer.