File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -660,6 +660,9 @@ public function testAssetUrl() {
660
660
661
661
$ result = $ this ->Helper ->assetUrl ('foo.jpg?one=two&three=four ' );
662
662
$ this ->assertEquals ('foo.jpg?one=two&three=four ' , $ result );
663
+
664
+ $ result = $ this ->Helper ->assetUrl ('dir/big+tall/image ' , array ('ext ' => '.jpg ' ));
665
+ $ this ->assertEquals ('dir/big%2Btall/image.jpg ' , $ result );
663
666
}
664
667
665
668
/**
@@ -674,7 +677,8 @@ public function testAssetUrlNoRewrite() {
674
677
'here ' => '/cake_dev/index.php/tasks ' ,
675
678
));
676
679
$ result = $ this ->Helper ->assetUrl ('img/cake.icon.png ' , array ('fullBase ' => true ));
677
- $ this ->assertEquals ('http://localhost/cake_dev/app/webroot/img/cake.icon.png ' , $ result );
680
+
681
+ $ this ->assertEquals ($ result , 'http:// ' . $ _SERVER ['HTTP_HOST ' ] . '/cake_dev/app/webroot/img/cake.icon.png ' );
678
682
}
679
683
680
684
/**
Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ public function assetUrl($path, $options = array()) {
341
341
*/
342
342
protected function _encodeUrl ($ url ) {
343
343
$ path = parse_url ($ url , PHP_URL_PATH );
344
- $ parts = array_map ('urldecode ' , explode ('/ ' , $ path ));
344
+ $ parts = array_map ('rawurldecode ' , explode ('/ ' , $ path ));
345
345
$ parts = array_map ('rawurlencode ' , $ parts );
346
346
$ encoded = implode ('/ ' , $ parts );
347
347
return h (str_replace ($ path , $ encoded , $ url ));
You can’t perform that action at this time.
0 commit comments