basecoat
basecoat copied to clipboard
Fixing Accidentally Removing all "/" from 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"