Skip to content

Commit

Permalink
Adding test cases for URL encoded values. Refs #6134
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8062 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
markstory committed Feb 25, 2009
1 parent af021cb commit 0be4f64
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cake/tests/cases/libs/view/helper.test.php
Expand Up @@ -361,6 +361,20 @@ function testUrlConversion() {

$result = $this->Helper->url(array('controller' => 'posts', 'action' => 'index', 'page' => '1" onclick="alert(\'XSS\');"'));
$this->assertEqual($result, "/posts/index/page:1" onclick="alert('XSS');"");

$result = $this->Helper->url('/controller/action/1/param:this+one+more');
$this->assertEqual($result, '/controller/action/1/param:this+one+more');

$result = $this->Helper->url('/controller/action/1/param:this%20one%20more');
$this->assertEqual($result, '/controller/action/1/param:this%20one%20more');

$result = $this->Helper->url('/controller/action/1/param:%7Baround%20here%7D%5Bthings%5D%5Bare%5D%24%24');
$this->assertEqual($result, '/controller/action/1/param:%7Baround%20here%7D%5Bthings%5D%5Bare%5D%24%24');

$result = $this->Helper->url(array(
'controller' => 'posts', 'action' => 'index', 'param' => '%7Baround%20here%7D%5Bthings%5D%5Bare%5D%24%24'
));
$this->assertEqual($result, "/posts/index/param:%7Baround%20here%7D%5Bthings%5D%5Bare%5D%24%24");
}
/**
* testFieldsWithSameName method
Expand Down

0 comments on commit 0be4f64

Please sign in to comment.