Fix some PHP notices when accessing WC Settings screen (https://github.com/woocommerce/woocommerce-admin/pull/828)
* Fix some PHP notices when accessing WC Settings screen * Add sanitization
This commit is contained in:
parent
1d5364f6a6
commit
83fdaf6cd6
|
@ -66,10 +66,11 @@ function wc_admin_get_embed_breadcrumbs() {
|
|||
'wc-status' => 'status',
|
||||
);
|
||||
$tab = '';
|
||||
$get_tab = isset( $_GET['tab'] ) && sanitize_text_field( wp_unslash( $_GET['tab'] ) );
|
||||
$get_tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : '';
|
||||
if ( isset( $_GET['page'] ) ) {
|
||||
if ( in_array( wp_unslash( $_GET['page'] ), array_keys( $pages_with_tabs ) ) ) {
|
||||
$tab = ! empty( $get_tab ) ? $get_tab . '-' : $pages_with_tabs[ $get_page ] . '-';
|
||||
$page = sanitize_text_field( wp_unslash( $_GET['page'] ) );
|
||||
if ( in_array( $page, array_keys( $pages_with_tabs ) ) ) {
|
||||
$tab = ! empty( $get_tab ) ? $get_tab . '-' : $pages_with_tabs[ $page ] . '-';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue