Skip to content

Commit

Permalink
Merge branch 'hotfix/3355'
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Jan 7, 2013
2 parents b46b073 + ebbb0bd commit 683765e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Router/Http/Literal.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function match(Request $request, $pathOffset = null)
$path = $uri->getPath();

if ($pathOffset !== null) {
if ($pathOffset >= 0 && strlen($path) >= $pathOffset) {
if ($pathOffset >= 0 && strlen($path) >= $pathOffset && !empty($this->route)) {
if (strpos($path, $this->route, $pathOffset) === $pathOffset) {
return new RouteMatch($this->defaults, strlen($this->route));
}
Expand Down
10 changes: 10 additions & 0 deletions tests/ZendTest/Mvc/Router/Http/LiteralTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,14 @@ public function testFactory()
)
);
}

/**
* @group ZF2-436
*/
public function testEmptyLiteral()
{
$request = new Request();
$route = new Literal('');
$this->assertNull($route->match($request, 0));
}
}

0 comments on commit 683765e

Please sign in to comment.