From 1d92c8fe000d1ac23437d31676ab4640eeb756ff Mon Sep 17 00:00:00 2001
From: minerva-VANB05 <minerva@trovaprezzi.it>
Date: Thu, 29 Aug 2024 14:42:02 +0200
Subject: [PATCH] add an hook for base_request_uri

---
 lib/class-wp-rest-oauth1.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/class-wp-rest-oauth1.php b/lib/class-wp-rest-oauth1.php
index 5023c62..0d843a5 100644
--- a/lib/class-wp-rest-oauth1.php
+++ b/lib/class-wp-rest-oauth1.php
@@ -700,7 +700,7 @@ public function check_oauth_signature( $consumer, $oauth_params, $token = null )
 		if ( substr( $request_path, 0, strlen( $wp_base ) ) === $wp_base ) {
 			$request_path = substr( $request_path, strlen( $wp_base ) );
 		}
-		$base_request_uri = self::urlencode_rfc3986( get_home_url( null, $request_path ) );
+        $base_request_uri = self::urlencode_rfc3986( apply_filters( 'oauth1_base_request_uri', get_home_url( null, $request_path ) ));
 
 		// get the signature provided by the consumer and remove it from the parameters prior to checking the signature.
 		$consumer_signature = rawurldecode( $params['oauth_signature'] );