Skip to content

Commit

Permalink
FIX Allow Director::$rules like //$Action
Browse files Browse the repository at this point in the history
In 3.0, doing $Action => SomeController would redirect all action requests
to that default controller. In 3.1, you need to do //$Action => SomeController
but it didnt work - those initial slashes broke matching
  • Loading branch information
Hamish Friedlander committed Apr 29, 2013
1 parent 8f64516 commit 0ae3050
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions control/HTTPRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ public function match($pattern, $shiftOnSuccess = false) {
$shiftCount = sizeof($patternParts);
}

// Filter out any "empty" matching parts - either from an initial / or a trailing /
$patternParts = array_values(array_filter($patternParts));

$arguments = array();
foreach($patternParts as $i => $part) {
$part = trim($part);
Expand Down

0 comments on commit 0ae3050

Please sign in to comment.