Merge pull request #549 from zoghal/fix2

urldecode trailing star
This commit is contained in:
Mark Story 2012-03-08 17:03:56 -08:00
commit 621b086d9c
2 changed files with 20 additions and 1 deletions

View file

@ -240,7 +240,7 @@ class CakeRoute {
}
if (isset($route['_trailing_'])) {
$route['pass'][] = $route['_trailing_'];
$route['pass'][] = rawurldecode($route['_trailing_']);
unset($route['_trailing_']);
}

View file

@ -857,4 +857,23 @@ class CakeRouteTest extends CakeTestCase {
);
$this->assertEquals($expected, $result);
}
/**
* Test the /** special type on parsing - UTF8.
*
* @return void
*/
public function testParseTrailingUTF8() {
$route = new CakeRoute( '/category/**', array('controller' => 'categories','action' => 'index'));
$result = $route->parse('/category/%D9%85%D9%88%D8%A8%D8%A7%DB%8C%D9%84');
$expected = array(
'controller' => 'categories',
'action' => 'index',
'pass' => array('موبایل'),
'named' => array()
);
$this->assertEquals($expected, $result);
}
}