BC fix for css() and script() with identical resource names

This commit is contained in:
Rachman Chavik 2014-11-19 10:56:15 +07:00
parent 7bea96f534
commit a37e007d9f

View file

@ -449,11 +449,11 @@ class HtmlHelper extends AppHelper {
return; return;
} }
if ($options['once'] && isset($this->_includedAssets[$path])) { if ($options['once'] && isset($this->_includedAssets[__METHOD__][$path])) {
return ''; return '';
} }
unset($options['once']); unset($options['once']);
$this->_includedAssets[$path] = true; $this->_includedAssets[__METHOD__][$path] = true;
if (strpos($path, '//') !== false) { if (strpos($path, '//') !== false) {
$url = $path; $url = $path;
@ -552,10 +552,10 @@ class HtmlHelper extends AppHelper {
} }
return null; return null;
} }
if ($options['once'] && isset($this->_includedAssets[$url])) { if ($options['once'] && isset($this->_includedAssets[__METHOD__][$url])) {
return null; return null;
} }
$this->_includedAssets[$url] = true; $this->_includedAssets[__METHOD__][$url] = true;
if (strpos($url, '//') === false) { if (strpos($url, '//') === false) {
$url = $this->assetUrl($url, $options + array('pathPrefix' => Configure::read('App.jsBaseUrl'), 'ext' => '.js')); $url = $this->assetUrl($url, $options + array('pathPrefix' => Configure::read('App.jsBaseUrl'), 'ext' => '.js'));