WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/01/2014 10:16:19 PM (6 years ago)
Author:
wonderboymusic
Message:

In customize.php, check that $autofocus is an array after running wp_unslash() instead of before. This is admittedly to skip a traversable hint in Scrutinizer.

See #30224.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r30102 r30164  
    283283
    284284    // Pass to frontend the Customizer construct being deeplinked
    285     if ( isset( $_GET['autofocus'] ) && is_array( $_GET['autofocus'] ) ) {
     285    if ( isset( $_GET['autofocus'] ) ) {
    286286        $autofocus = wp_unslash( $_GET['autofocus'] );
    287         foreach ( $autofocus as $type => $id ) {
    288             if ( isset( $settings[ $type . 's' ][ $id ] ) ) {
    289                 $settings['autofocus'][ $type ] = $id;
     287        if ( is_array( $autofocus ) ) {
     288            foreach ( $autofocus as $type => $id ) {
     289                if ( isset( $settings[ $type . 's' ][ $id ] ) ) {
     290                    $settings['autofocus'][ $type ] = $id;
     291                }
    290292            }
    291293        }
Note: See TracChangeset for help on using the changeset viewer.