diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index ab1f0bcba39..f3207b93c9d 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -32,7 +32,7 @@ class WC_AJAX { * @return string */ public static function get_endpoint( $request = '' ) { - return esc_url_raw( apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ), home_url( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ), $request ) ); + return esc_url_raw( apply_filters( 'woocommerce_ajax_get_endpoint', add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ), home_url( '/' ) ) ), $request ) ); } /**