Ensure Requirements_Backend respects explicit false for async/defer

This commit is contained in:
Michal Kleiner 2019-10-30 09:47:24 +13:00
parent 0cf5d4cbe2
commit 4f614423ad

View File

@ -416,19 +416,19 @@ class Requirements_Backend
// make sure that async/defer is set if it is set once even if file is included multiple times
$async = (
isset($options['async']) && isset($options['async']) == true
isset($options['async']) && $options['async']
|| (
isset($this->javascript[$file])
&& isset($this->javascript[$file]['async'])
&& $this->javascript[$file]['async'] == true
&& $this->javascript[$file]['async']
)
);
$defer = (
isset($options['defer']) && isset($options['defer']) == true
isset($options['defer']) && $options['defer']
|| (
isset($this->javascript[$file])
&& isset($this->javascript[$file]['defer'])
&& $this->javascript[$file]['defer'] == true
&& $this->javascript[$file]['defer']
)
);
$this->javascript[$file] = array(