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.


git-svn-id: https://develop.svn.wordpress.org/trunk@30164 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-11-01 22:16:19 +00:00
parent 64f773e4da
commit b4d0961718
1 changed files with 6 additions and 4 deletions

View File

@ -282,11 +282,13 @@ do_action( 'customize_controls_print_scripts' );
}
// Pass to frontend the Customizer construct being deeplinked
if ( isset( $_GET['autofocus'] ) && is_array( $_GET['autofocus'] ) ) {
if ( isset( $_GET['autofocus'] ) ) {
$autofocus = wp_unslash( $_GET['autofocus'] );
foreach ( $autofocus as $type => $id ) {
if ( isset( $settings[ $type . 's' ][ $id ] ) ) {
$settings['autofocus'][ $type ] = $id;
if ( is_array( $autofocus ) ) {
foreach ( $autofocus as $type => $id ) {
if ( isset( $settings[ $type . 's' ][ $id ] ) ) {
$settings['autofocus'][ $type ] = $id;
}
}
}
}