Permalink
Browse files

Fix for GitHub issue 2511

  • Loading branch information...
1 parent 508ed58 commit 0c0bb57d84637cc596775d0913ad5b1bf1e1c909 @nemekzg committed Jan 5, 2013
Showing with 11 additions and 1 deletion.
  1. +1 −1 library/Zend/Mvc/Router/Http/Literal.php
  2. +10 −0 tests/ZendTest/Mvc/Router/Http/LiteralTest.php
@@ -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));
}
@@ -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.