Skip to content

Commit 8418bde

Browse files
author
Kaspars Dambis
committed
Ensure that required data is defined before using it
1 parent d0a3d7d commit 8418bde

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

search/includes/classes/class-search.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,8 +1188,8 @@ public function ep_handle_failed_request( $request, $response, $query, $type, $c
11881188
return;
11891189
}
11901190

1191-
if ( ! $is_cli ) {
1192-
global $wp;
1191+
global $wp;
1192+
if ( ! $is_cli && isset( $wp->query_vars ) && isset( $_SERVER['REQUEST_URI'] ) ) {
11931193
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.ValidatedSanitizedInput.InputNotValidated
11941194
$request_url_for_logging = esc_url_raw( add_query_arg( $wp->query_vars, home_url( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
11951195
}

0 commit comments

Comments
 (0)