Skip to content

Commit

Permalink
[Routing] Fixed undefined variable + typo
Browse files Browse the repository at this point in the history
  • Loading branch information
pborreli committed Nov 17, 2012
1 parent 4ad1e14 commit f7ea68f
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ public function dump(array $options = array())
$rules = array("# skip \"real\" requests\nRewriteCond %{REQUEST_FILENAME} -f\nRewriteRule .* - [QSA,L]");
$methodVars = array();
$hostnameRegexUnique = 0;
$prevHosnameRegex = '';
$prevHostnameRegex = '';

foreach ($this->getRoutes()->all() as $name => $route) {

$compiledRoute = $route->compile();
$hostnameRegex = $compiledRoute->getHostnameRegex();

if (null !== $hostnameRegex && $prevHosnameRegex !== $hostnameRegex) {
if (null !== $hostnameRegex && $prevHostnameRegex !== $hostnameRegex) {

$prevHosnameRegex = $hostnameRegex;
$prevHostnameRegex = $hostnameRegex;
$hostnameRegexUnique++;

$rule = array();
Expand Down Expand Up @@ -217,7 +217,7 @@ private function regexToApacheRegex($regex)
$delimiter = $regex[0];
$regexPatternEnd = strrpos($regex, $delimiter);
if (strlen($regex) < 2 || 0 === $regexPatternEnd) {
throw new \LogicException('The "%s" route regex "%s" is invalid', $name, $regex);
throw new \LogicException('The route regex "%s" is invalid', $regex);
}
$regex = preg_replace('/\?<.+?>/', '', substr($regex, 1, $regexPatternEnd - 1));

Expand Down

0 comments on commit f7ea68f

Please sign in to comment.