Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'hotfix/3355' into develop

Forward port #3355
  • Loading branch information...
commit e9c7523a2e310618cad461635608dedcb0ce79ee 2 parents 636e15a + ebbb0bd
@weierophinney weierophinney 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.