Skip to content

Commit

Permalink
Minor fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
dev4press committed Dec 3, 2022
1 parent 002b7df commit 0ee43ba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/main/WP.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ public function current_url( $use_wp = true ) : string {
}

public function current_url_request() : string {
$pathinfo = isset( $_SERVER['PATH_INFO'] ) ? $_SERVER['PATH_INFO'] : '';
$pathinfo = $_SERVER['PATH_INFO'] ?? '';
list( $pathinfo ) = explode( '?', $pathinfo );
$pathinfo = str_replace( '%', '%25', $pathinfo );

$request = explode( '?', $_SERVER['REQUEST_URI'] );
$req_uri = $request[0];
$req_query = isset( $request[1] ) ? $request[1] : false;
$home_path = trim( parse_url( home_url(), PHP_URL_PATH ), '/' );
$req_query = $request[1] ?? false;
$home_path = parse_url( home_url(), PHP_URL_PATH );
$home_path = $home_path ? trim( $home_path, '/' ) : '';
$home_path_regex = sprintf( '|^%s|i', preg_quote( $home_path, '|' ) );

$req_uri = str_replace( $pathinfo, '', $req_uri );
Expand Down

0 comments on commit 0ee43ba

Please sign in to comment.