Development

Changeset 7901

You must first sign up to be able to contribute.

Changeset 7901

Show
Ignore:
Timestamp:
03/15/08 13:56:27 (2 years ago)
Author:
fabien
Message:

fixed sf1.1 has changed routing (closes #3090)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/routing/sfPatternRouting.class.php

    r7825 r7901  
    315315      } 
    316316    } 
     317    $givenDefaults = $defaults; 
    317318    $defaults = $this->fixDefaults($defaults); 
    318319 
     
    335336    if (!empty($route) && '/' == $route[0]) 
    336337    { 
    337       $route = substr($route, 1);  
     338      $route = substr($route, 1); 
    338339    } 
    339340 
     
    387388          $currentSeparator = ''; 
    388389 
     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 
    389398          if (!isset($defaults[$variable])) 
    390399          { 
  • branches/1.1/test/unit/routing/sfPatternRoutingTest.php

    r7863 r7901  
    119119$r->connect('test', '/:module/:action/test/:id/:test', array('module' => 'default', 'action' => 'index')); 
    120120$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'); 
    122122$url = '/default/index/test/foo'; 
    123123$t->is($r->parse($url), $params, '->parse()    takes the first matching route'); 
     
    510510$t->is($r->parse('/test1/value/test%26foo%3Dbar%2Bfoo'), array('module' => 'default', 'action' => 'index', 'value' => 'test&foo=bar+foo'), '->parse() decodes parameter values'); 
    511511 
    512  
    513512// feature change bug from sf1.0 - ticket #3090 
    514513$r->clearRoutes(); 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.