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

Commit

Permalink
Merge branch 'hotfix/2398'
Browse files Browse the repository at this point in the history
Close #2398
  • Loading branch information
weierophinney committed Sep 21, 2012
2 parents 284985f + 616c099 commit b24353e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/Zend/Mvc/Router/Http/Segment.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ protected function buildPath(array $parts, array $mergedParams, $isOptional, $ha
$skippable = true;
$optionalPart = $this->buildPath($part[1], $mergedParams, true, $hasChild);

if ($optionalPart !== null) {
if ($optionalPart !== '') {
$path .= $optionalPart;
$skip = false;
}
Expand Down
6 changes: 6 additions & 0 deletions tests/ZendTest/Mvc/Router/Http/SegmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ public static function routeProvider()
null,
array('foo' => 'bar', 'bar' => 'baz')
),
'optional-group-within-optional-group-is-ignored' => array(
new Segment('/:foo[/:bar[/:baz]]', array(), array('bar' => 'baz', 'baz' => 'bat')),
'/bar',
null,
array('foo' => 'bar', 'bar' => 'baz', 'baz' => 'bat')
),
'non-standard-delimiter-before-parameter' => array(
new Segment('/foo-:bar'),
'/foo-baz',
Expand Down

0 comments on commit b24353e

Please sign in to comment.