Fix exception thrown during re-routing without parameters

This commit is contained in:
Johannes Meyer 2014-03-27 12:04:10 +01:00
parent 8d29620350
commit 3beec6e102
1 changed files with 6 additions and 1 deletions

View File

@ -25,7 +25,12 @@ if (substr($ruri, 0, strlen($remove)) !== $remove) {
} }
$ruri = substr($ruri, strlen($remove)); $ruri = substr($ruri, strlen($remove));
list($path, $params) = preg_split('/\?/', $ruri, 2); if (strpos($ruri, '?') === false) {
$params = '';
$path = $ruri;
} else {
list($path, $params) = preg_split('/\?/', $ruri, 2);
}
$ruriParts = preg_split('~/~', ltrim($ruri, '/')); $ruriParts = preg_split('~/~', ltrim($ruri, '/'));
if (count($ruriParts) === 2 && if (count($ruriParts) === 2 &&
($ruriParts[0] === 'css' || $ruriParts[0] === 'js') ($ruriParts[0] === 'css' || $ruriParts[0] === 'js')