summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/masterbar/admin-menu/load.php')
-rw-r--r--plugins/jetpack/modules/masterbar/admin-menu/load.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/jetpack/modules/masterbar/admin-menu/load.php b/plugins/jetpack/modules/masterbar/admin-menu/load.php
index 412819ef..cedb92bb 100644
--- a/plugins/jetpack/modules/masterbar/admin-menu/load.php
+++ b/plugins/jetpack/modules/masterbar/admin-menu/load.php
@@ -23,7 +23,7 @@ function should_customize_nav( $admin_menu_class ) {
return false;
}
- $is_api_request = defined( 'REST_REQUEST' ) && REST_REQUEST || 0 === strpos( $_SERVER['REQUEST_URI'], '/?rest_route=%2Fwpcom%2Fv2%2Fadmin-menu' );
+ $is_api_request = defined( 'REST_REQUEST' ) && REST_REQUEST || isset( $_SERVER['REQUEST_URI'] ) && 0 === strpos( filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ) ), '/?rest_route=%2Fwpcom%2Fv2%2Fadmin-menu' );
// No nav customizations on WP Admin of Atomic sites when SSO is disabled.
if ( is_a( $admin_menu_class, Atomic_Admin_Menu::class, true ) && ! $is_api_request && ! \Jetpack::is_module_active( 'sso' ) ) {