From 38342889227ff21e53e5e3c3d6d2c9388d043b1d Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Tue, 25 Jul 2023 14:34:14 +0200 Subject: [PATCH] fix issue with API endpoint of WordPress.com --- includes/class-signature.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-signature.php b/includes/class-signature.php index b7c98fc..5ae37a9 100644 --- a/includes/class-signature.php +++ b/includes/class-signature.php @@ -156,7 +156,7 @@ class Signature { public static function verify_http_signature( $request ) { if ( is_object( $request ) ) { // REST Request object // check if route starts with "index.php" - if ( str_starts_with( $request->get_route(), '/index.php' ) ) { + if ( str_starts_with( $request->get_route(), '/index.php' ) || ! rest_get_url_prefix() ) { $route = $request->get_route(); } else { $route = '/' . rest_get_url_prefix() . '/' . ltrim( $request->get_route(), '/' );