Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Http/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ function () use ( $route, $methods, $args ) {
}

private function get_current_route(): string {
$wp_url = get_site_url();
$installed_dir = wp_parse_url( $wp_url, PHP_URL_PATH );
$wp_url = get_site_url();

// wp_parse_url() can return null when site_url is root of the domain and doesn't have a trailing slash.
$installed_dir = wp_parse_url( $wp_url, PHP_URL_PATH ) ?? '';

// Requested URI relative to WP install.
$uri = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
Expand Down