mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-05 19:12:42 +00:00
URL encode image/script/css/video paths.
Properly urlencode urls used in HTML attributes. This solves issues with invalid HTML being generated when paths contain special characters. Fixes #3395
This commit is contained in:
parent
b41705f59e
commit
1f35d82c81
2 changed files with 19 additions and 1 deletions
|
@ -622,6 +622,9 @@ class HelperTest extends CakeTestCase {
|
|||
$result = $this->Helper->assetUrl('style', array('ext' => '.css'));
|
||||
$this->assertEquals('style.css', $result);
|
||||
|
||||
$result = $this->Helper->assetUrl('dir/sub dir/my image', array('ext' => '.jpg'));
|
||||
$this->assertEquals('dir/sub%20dir/my%20image.jpg', $result);
|
||||
|
||||
$result = $this->Helper->assetUrl('foo.jpg?one=two&three=four');
|
||||
$this->assertEquals('foo.jpg?one=two&three=four', $result);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue