Changeset 7901
- Timestamp:
- 03/15/08 13:56:27 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/routing/sfPatternRouting.class.php
r7825 r7901 315 315 } 316 316 } 317 $givenDefaults = $defaults; 317 318 $defaults = $this->fixDefaults($defaults); 318 319 … … 335 336 if (!empty($route) && '/' == $route[0]) 336 337 { 337 $route = substr($route, 1); 338 $route = substr($route, 1); 338 339 } 339 340 … … 387 388 $currentSeparator = ''; 388 389 390 // for 1.0 BC, we don't take into account the default module and action variable 391 // for 1.2, remove the $givenDefaults var and move the $firstOptional setting to 392 // the condition below 393 if (!isset($givenDefaults[$variable])) 394 { 395 $firstOptional = count($segments); 396 } 397 389 398 if (!isset($defaults[$variable])) 390 399 { branches/1.1/test/unit/routing/sfPatternRoutingTest.php
r7863 r7901 119 119 $r->connect('test', '/:module/:action/test/:id/:test', array('module' => 'default', 'action' => 'index')); 120 120 $r->connect('test1', '/:module/:action/test/:id', array('module' => 'default', 'action' => 'index', 'id' => 'foo')); 121 $params = array('module' => 'default', 'action' => 'index', 'id' => 'foo' , 'test' => null);121 $params = array('module' => 'default', 'action' => 'index', 'id' => 'foo'); 122 122 $url = '/default/index/test/foo'; 123 123 $t->is($r->parse($url), $params, '->parse() takes the first matching route'); … … 510 510 $t->is($r->parse('/test1/value/test%26foo%3Dbar%2Bfoo'), array('module' => 'default', 'action' => 'index', 'value' => 'test&foo=bar+foo'), '->parse() decodes parameter values'); 511 511 512 513 512 // feature change bug from sf1.0 - ticket #3090 514 513 $r->clearRoutes();

