fix issue with API endpoint of WordPress.com

This commit is contained in:
Matthias Pfefferle 2023-07-25 14:34:14 +02:00
parent 38cd0b973b
commit 3834288922

View file

@ -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(), '/' );