Permalink
Browse files

Merge branch 'zf2511' of git://github.com/nemekzg/zf2 into hotfix/3355

  • Loading branch information...
2 parents b46b073 + 0c0bb57 commit ebbb0bdebdb944ec209dd6f3a7e2d1e43e384ac3 @weierophinney weierophinney committed Jan 7, 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 ebbb0bd

Please sign in to comment.