Replace SERVER['REQUEST_URI'] in favor of add_query_arg.
This commit is contained in:
parent
f51265e58d
commit
284239ee44
|
@ -75,12 +75,9 @@ class WC_REST_Authentication {
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function is_request_to_wccom_site_rest_api() {
|
protected function is_request_to_wccom_site_rest_api() {
|
||||||
if ( empty( $_SERVER['REQUEST_URI'] ) ) {
|
$request_uri = add_query_arg( array() );
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$rest_prefix = trailingslashit( rest_get_url_prefix() );
|
$rest_prefix = trailingslashit( rest_get_url_prefix() );
|
||||||
$request_uri = esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) );
|
$request_uri = esc_url_raw( wp_unslash( $request_uri ) );
|
||||||
|
|
||||||
return false !== strpos( $request_uri, $rest_prefix . 'wccom-site/' );
|
return false !== strpos( $request_uri, $rest_prefix . 'wccom-site/' );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue