From 7e5d6c48ecca4cde07dac2abbf351a76ad6fbbe6 Mon Sep 17 00:00:00 2001 From: LyNguyen Date: Mon, 29 Jan 2024 09:56:19 +0700 Subject: [PATCH] Fix bug duplicate home_url and page link (#114) --- src/Schema/Types/Base.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Schema/Types/Base.php b/src/Schema/Types/Base.php index 10c4e3dd..569a61f7 100644 --- a/src/Schema/Types/Base.php +++ b/src/Schema/Types/Base.php @@ -22,12 +22,10 @@ private function get_current_url(): string { global $wp; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput - $url = $_SERVER['REQUEST_URI'] ?? add_query_arg( [], $wp->request ); - $url = home_url( $url ); + $url = home_url( add_query_arg( [], $wp->request ) ); $url = esc_url( wp_strip_all_tags( $url ) ); $url = strtok( $url, '#' ); $url = strtok( $url, '?' ); - return $url; }