Skip to content

Commit 88754ca

Browse files
committed
Merge pull request #12 from mfairchild365/agnostic-w-port
php will return `false` if the URL is agnostic and contain a port
2 parents 7f4adfd + 2b82ce8 commit 88754ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/RegExpRouter/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function route($requestURI, array $options = array())
9090
$path = parse_url($this->baseURL, PHP_URL_PATH);
9191

9292
//PHP < 5.4.7 does not parse agnostic URLs. The path is always the entire URL.
93-
if ($path == $this->baseURL && strpos($this->baseURL, '//') === 0) {
93+
if ((($path == $this->baseURL) || $path === false) && strpos($this->baseURL, '//') === 0) {
9494
$path_start = strpos($this->baseURL, '/', 2);
9595
$path = substr($this->baseURL, $path_start);
9696
}

0 commit comments

Comments
 (0)