Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fragments should not be urlencoded()

encoding them breaks fragments for client side
applications like backbone.js

Fixes #2755
  • Loading branch information...
commit fe1a6d7d7e271a53c94ca9f2637ca90e0c2f1815 1 parent b3419be
@markstory markstory authored
View
2  lib/Cake/Routing/Router.php
@@ -778,7 +778,7 @@ public static function url($url = null, $full = false) {
unset($url['?']);
}
if (isset($url['#'])) {
- $frag = '#' . urlencode($url['#']);
+ $frag = '#' . $url['#'];
unset($url['#']);
}
if (isset($url['ext'])) {
View
2  lib/Cake/Test/Case/Routing/RouterTest.php
@@ -527,7 +527,7 @@ public function testUrlGenerationWithQueryStrings() {
$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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.