Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix for GitHub issue 2511

  • Loading branch information...
commit 0c0bb57d84637cc596775d0913ad5b1bf1e1c909 1 parent 508ed58
@nemekzg nemekzg authored
View
2  library/Zend/Mvc/Router/Http/Literal.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));
}
View
10 tests/ZendTest/Mvc/Router/Http/LiteralTest.php
@@ -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));
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.