mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 13:02:40 +00:00
Fragments should not be urlencoded()
encoding them breaks fragments for client side applications like backbone.js Fixes #2755
This commit is contained in:
parent
b3419be0fb
commit
fe1a6d7d7e
2 changed files with 2 additions and 2 deletions
|
@ -778,7 +778,7 @@ class Router {
|
|||
unset($url['?']);
|
||||
}
|
||||
if (isset($url['#'])) {
|
||||
$frag = '#' . urlencode($url['#']);
|
||||
$frag = '#' . $url['#'];
|
||||
unset($url['#']);
|
||||
}
|
||||
if (isset($url['ext'])) {
|
||||
|
|
|
@ -527,7 +527,7 @@ class RouterTest extends CakeTestCase {
|
|||
$this->assertEquals('/posts/index/0', $result);
|
||||
|
||||
$result = Router::url(array('controller' => 'posts', '0', '?' => 'var=test&var2=test2', '#' => 'unencoded string %'));
|
||||
$expected = '/posts/index/0?var=test&var2=test2#unencoded+string+%25';
|
||||
$expected = '/posts/index/0?var=test&var2=test2#unencoded string %';
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue