diff --git a/lib/Cake/Test/Case/View/HelperTest.php b/lib/Cake/Test/Case/View/HelperTest.php index 564b6dc20..b588fda7e 100644 --- a/lib/Cake/Test/Case/View/HelperTest.php +++ b/lib/Cake/Test/Case/View/HelperTest.php @@ -660,6 +660,9 @@ class HelperTest extends CakeTestCase { $result = $this->Helper->assetUrl('foo.jpg?one=two&three=four'); $this->assertEquals('foo.jpg?one=two&three=four', $result); + + $result = $this->Helper->assetUrl('dir/big+tall/image', array('ext' => '.jpg')); + $this->assertEquals('dir/big%2Btall/image.jpg', $result); } /** @@ -674,7 +677,8 @@ class HelperTest extends CakeTestCase { 'here' => '/cake_dev/index.php/tasks', )); $result = $this->Helper->assetUrl('img/cake.icon.png', array('fullBase' => true)); - $this->assertEquals('http://localhost/cake_dev/app/webroot/img/cake.icon.png', $result); + + $this->assertEquals($result, 'http://' . $_SERVER['HTTP_HOST'] . '/cake_dev/app/webroot/img/cake.icon.png'); } /** diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php index 847f5d841..52f779601 100644 --- a/lib/Cake/View/Helper.php +++ b/lib/Cake/View/Helper.php @@ -341,7 +341,7 @@ class Helper extends Object { */ protected function _encodeUrl($url) { $path = parse_url($url, PHP_URL_PATH); - $parts = array_map('urldecode', explode('/', $path)); + $parts = array_map('rawurldecode', explode('/', $path)); $parts = array_map('rawurlencode', $parts); $encoded = implode('/', $parts); return h(str_replace($path, $encoded, $url));