Changeset 10593
- Timestamp:
- 08/01/08 18:02:18 (4 months ago)
- Files:
-
- branches/1.2/lib/routing/sfPatternRouting.class.php (modified) (1 diff)
- branches/1.2/lib/widget/sfWidget.class.php (modified) (1 diff)
- branches/1.2/test/unit/routing/sfPatternRoutingTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.2/lib/routing/sfPatternRouting.class.php
r10200 r10593 559 559 // replace variables 560 560 $realUrl = $url; 561 foreach ($variables as $variable => $value) 561 562 $tmp = $variables; 563 uasort($tmp, create_function('$a, $b', 'return strlen($a) < strlen($b);')); 564 foreach ($tmp as $variable => $value) 562 565 { 563 566 $realUrl = str_replace($value, urlencode($tparams[$variable]), $realUrl); branches/1.2/lib/widget/sfWidget.class.php
r9046 r10593 276 276 } 277 277 278 return sprintf('<%s%s%s', $tag, $this->attributesToHtml($attributes), self::$xhtml ? ' />' : sprintf('></%s>', $tag));278 return sprintf('<%s%s%s', $tag, $this->attributesToHtml($attributes), self::$xhtml ? ' />' : ('input' != $tag ? sprintf('></%s>', $tag) : '>')); 279 279 } 280 280 branches/1.2/test/unit/routing/sfPatternRoutingTest.php
r8806 r10593 11 11 require_once(dirname(__FILE__).'/../../bootstrap/unit.php'); 12 12 13 $t = new lime_test(13 5, new lime_output_color());13 $t = new lime_test(136, new lime_output_color()); 14 14 15 15 class sfPatternRoutingTest extends sfPatternRouting … … 537 537 $params = array('module' => 'default', 'action' => 'action', 'param1' => 'param1'); 538 538 $t->is($r->parse($url), $params, 'parse /customer/:param1/:action/* route'); 539 540 $r->clearRoutes(); 541 $r->connect('test', '/customer/:id/:id_name', array('module' => 'default')); 542 $t->is($r->generate('', array('id' => 2, 'id_name' => 'fabien')), '/customer/2/fabien', '->generate() first replaces the longest variable names');