basecoat icon indicating copy to clipboard operation
basecoat copied to clipboard

Fixing Accidentally Removing all "/" from route

Open stefanhayden opened this issue 11 years ago • 0 comments

$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"

stefanhayden avatar Aug 13 '13 04:08 stefanhayden