mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Merge pull request #5205 from rchavik/2.6-fix-html-helper-regression
2.6 Fix html helper regression
This commit is contained in:
commit
54ee34af1f
2 changed files with 20 additions and 4 deletions
|
@ -899,6 +899,22 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
CakePlugin::unload('TestPlugin');
|
||||
}
|
||||
|
||||
/**
|
||||
* Resource names must be treated differently for css() and script()
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBufferedCssAndScriptWithIdenticalResourceName() {
|
||||
$this->View->expects($this->at(0))
|
||||
->method('append')
|
||||
->with('css', $this->stringContains('test.min.css'));
|
||||
$this->View->expects($this->at(1))
|
||||
->method('append')
|
||||
->with('script', $this->stringContains('test.min.js'));
|
||||
$this->Html->css('test.min', array('inline' => false));
|
||||
$this->Html->script('test.min', array('inline' => false));
|
||||
}
|
||||
|
||||
/**
|
||||
* test timestamp enforcement for script tags.
|
||||
*
|
||||
|
|
|
@ -449,11 +449,11 @@ class HtmlHelper extends AppHelper {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($options['once'] && isset($this->_includedAssets[$path])) {
|
||||
if ($options['once'] && isset($this->_includedAssets[__METHOD__][$path])) {
|
||||
return '';
|
||||
}
|
||||
unset($options['once']);
|
||||
$this->_includedAssets[$path] = true;
|
||||
$this->_includedAssets[__METHOD__][$path] = true;
|
||||
|
||||
if (strpos($path, '//') !== false) {
|
||||
$url = $path;
|
||||
|
@ -552,10 +552,10 @@ class HtmlHelper extends AppHelper {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
if ($options['once'] && isset($this->_includedAssets[$url])) {
|
||||
if ($options['once'] && isset($this->_includedAssets[__METHOD__][$url])) {
|
||||
return null;
|
||||
}
|
||||
$this->_includedAssets[$url] = true;
|
||||
$this->_includedAssets[__METHOD__][$url] = true;
|
||||
|
||||
if (strpos($url, '//') === false) {
|
||||
$url = $this->assetUrl($url, $options + array('pathPrefix' => Configure::read('App.jsBaseUrl'), 'ext' => '.js'));
|
||||
|
|
Loading…
Add table
Reference in a new issue