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:
parent
64f773e4da
commit
b4d0961718
|
@ -282,11 +282,13 @@ do_action( 'customize_controls_print_scripts' );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pass to frontend the Customizer construct being deeplinked
|
// 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'] );
|
$autofocus = wp_unslash( $_GET['autofocus'] );
|
||||||
foreach ( $autofocus as $type => $id ) {
|
if ( is_array( $autofocus ) ) {
|
||||||
if ( isset( $settings[ $type . 's' ][ $id ] ) ) {
|
foreach ( $autofocus as $type => $id ) {
|
||||||
$settings['autofocus'][ $type ] = $id;
|
if ( isset( $settings[ $type . 's' ][ $id ] ) ) {
|
||||||
|
$settings['autofocus'][ $type ] = $id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue