Skip to content

Conversation

@stefanhayden
Copy link
Contributor

$url_path = str_replace(dirname($_SERVER['PHP_SELF']), '', $this->requested_url);

if $_SERVER['PHP_SELF'] is "/index.php" the the dirname is "/"

if you do a string replace on "http://domain.com/some/route" with a dirname of "/" then the result is "http:domain.comsomeroute" which makes no sense.

Simply passing parse_url($this->requested_url, PHP_URL_PATH) should output the correct string of "some/route"

$url_path	= str_replace(dirname($_SERVER['PHP_SELF']), '', $this->requested_url);

if $_SERVER['PHP_SELF'] is "/index.php" the the dirname is "/"

if you do a string replace on "http://domain.com/some/route" with a dirname of "/" then the result is "http:domain.comsomeroute" which makes no sense.

Simply passing parse_url($this->requested_url, PHP_URL_PATH) should output the correct string of "some/route"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant