Skip to content

Commit

Permalink
Altering Helper::url() to enforce escaped query strings for generated…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
markstory committed Jan 14, 2009
1 parent de1d1ae commit b94a85e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/view/helper.php
Expand Up @@ -175,7 +175,7 @@ function loadConfig($name = 'tags') {
* @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
Expand Down
10 changes: 10 additions & 0 deletions cake/tests/cases/libs/view/helpers/html.test.php
Expand Up @@ -148,6 +148,16 @@ function testLink() {
'/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);

Expand Down

0 comments on commit b94a85e

Please sign in to comment.