Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Fix for GitHub issue 2511
Browse files Browse the repository at this point in the history
  • Loading branch information
nemekzg committed Jan 5, 2013
1 parent 508ed58 commit 0c0bb57
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
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
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 0c0bb57

Please sign in to comment.