WordPress.org

Make WordPress Core

Changeset 36148


Ignore:
Timestamp:
01/02/2016 03:38:45 AM (4 years ago)
Author:
dd32
Message:

Widgets: Revert [34465], as it introduced a regression, making the $index argument of dynamic_sidebar() case-sensitive.

Merges [36130] to the 4.4 branch.
See #23423.
Fixes #34995.

Location:
branches/4.4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/src/wp-includes/widgets.php

    r35725 r36148  
    608608        $index = "sidebar-$index";
    609609    } else {
    610         $sanitized_index = sanitize_title( $index );
     610        $index = sanitize_title( $index );
    611611        foreach ( (array) $wp_registered_sidebars as $key => $value ) {
    612             if ( sanitize_title( $value['name'] ) == $sanitized_index ) {
     612            if ( sanitize_title( $value['name'] ) == $index ) {
    613613                $index = $key;
    614614                break;
  • branches/4.4/tests/phpunit/tests/widgets.php

    r35272 r36148  
    534534        $option_value = get_option( $wp_widget_search->option_name );
    535535        $this->assertArrayNotHasKey( 2, $option_value );
    536     }
    537 
    538     /**
    539      * @ticket 23423
    540      */
    541     function test_dynamic_sidebar_id_special_characters() {
    542         wp_widgets_init();
    543         register_sidebar( array(
    544             'name' => 'Sidebar 2',
    545             'id' => 'sidebar-2',
    546         ) );
    547 
    548         ob_start();
    549         $result = dynamic_sidebar( 'Sidebar 1' );
    550         ob_end_clean();
    551 
    552         $this->assertFalse( $result );
    553536    }
    554537
Note: See TracChangeset for help on using the changeset viewer.