Altering Helper::url() to enforce escaped query strings for generated urls.

Tests added to Html::link().  Fixes #5982

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7991 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
mark_story 2009-01-14 22:41:47 +00:00
parent de1d1ae3bd
commit b94a85e938
2 changed files with 11 additions and 1 deletions

View file

@ -175,7 +175,7 @@ class Helper extends Overloadable {
* @return string Full translated URL with base path.
*/
function url($url = null, $full = false) {
return Router::url($url, $full);
return Router::url($url, array('full' => $full, 'escape' => true));
}
/**
* Checks if a file exists when theme is used, if no file is found default location is returned

View file

@ -148,6 +148,16 @@ class HtmlHelperTest extends CakeTestCase {
'/a'
);
$this->assertTags($result, $expected);
$result = $this->Html->link('Original size', array(
'controller' => 'images', 'action' => 'view', 3, '?' => array('height' => 100, 'width' => 200)
));
$expected = array(
'a' => array('href' => '/images/view/3?height=100&width=200'),
'Original size',
'/a'
);
$this->assertTags($result, $expected);
Configure::write('Asset.timestamp', false);