Skip to content

Commit

Permalink
Fix bug duplicate home_url and page link (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatrangnet authored Jan 29, 2024
1 parent 3b41668 commit 7e5d6c4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Schema/Types/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7e5d6c4

Please sign in to comment.