mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
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:
parent
de1d1ae3bd
commit
b94a85e938
2 changed files with 11 additions and 1 deletions
|
@ -175,7 +175,7 @@ class Helper extends Overloadable {
|
||||||
* @return string Full translated URL with base path.
|
* @return string Full translated URL with base path.
|
||||||
*/
|
*/
|
||||||
function url($url = null, $full = false) {
|
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
|
* Checks if a file exists when theme is used, if no file is found default location is returned
|
||||||
|
|
|
@ -148,6 +148,16 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
'/a'
|
'/a'
|
||||||
);
|
);
|
||||||
$this->assertTags($result, $expected);
|
$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);
|
Configure::write('Asset.timestamp', false);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue