mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Fix for relative protocol on assets
This commit is contained in:
parent
316c6582ea
commit
db6d0a748b
2 changed files with 4 additions and 1 deletions
|
@ -414,6 +414,9 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
|
|
||||||
$result = $this->Html->image('test.gif', array('pathPrefix' => 'http://cakephp.org/assets/img/'));
|
$result = $this->Html->image('test.gif', array('pathPrefix' => 'http://cakephp.org/assets/img/'));
|
||||||
$this->assertTags($result, array('img' => array('src' => 'http://cakephp.org/assets/img/test.gif', 'alt' => '')));
|
$this->assertTags($result, array('img' => array('src' => 'http://cakephp.org/assets/img/test.gif', 'alt' => '')));
|
||||||
|
|
||||||
|
$result = $this->Html->image('test.gif', array('pathPrefix' => '//cakephp.org/assets/img/'));
|
||||||
|
$this->assertTags($result, array('img' => array('src' => '//cakephp.org/assets/img/test.gif', 'alt' => '')));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -322,7 +322,7 @@ class Helper extends Object {
|
||||||
) {
|
) {
|
||||||
$path .= $options['ext'];
|
$path .= $options['ext'];
|
||||||
}
|
}
|
||||||
if (strpos($path, '://') !== false) {
|
if (preg_match('|^([a-z0-9]+:)?//|', $path)) {
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
if (isset($plugin)) {
|
if (isset($plugin)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue