Skip to content

Commit

Permalink
Fixed a bug where CSS code was cached even when caching was disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Dec 1, 2017
1 parent 5bc1983 commit ac6ef87
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions system/classes/Cache.php
Expand Up @@ -57,6 +57,16 @@ public static function enable()
self::$isEnabled = false;
}

/**
* Return if caching is enabled
*
* @return bool true if caching is enabled
*/
public static function isEnabled()
{
return self::$isEnabled;
}

/**
* Clear all cached data
*/
Expand Down
4 changes: 2 additions & 2 deletions system/classes/Resource.php
Expand Up @@ -683,7 +683,7 @@ private function minifyCSS(array $files)
{
global $LANG_DIRECTION;

if ($this->debug) {
if ($this->debug || !Cache::isEnabled()) {
$retval = '';

foreach ($files as $file) {
Expand Down Expand Up @@ -1185,7 +1185,7 @@ public function getFooter()
usort($this->externalJsFiles['footer'], array('\\Geeklog\\Resource', 'comparePriority'));

foreach ($this->externalJsFiles['footer'] as $jsFile) {
$retval .= sprintf('<script src="%s"></script>', $jsFile['file']) . PHP_EOL;
$retval .= sprintf('<script src="%s" async defer></script>', $jsFile['file']) . PHP_EOL;
}
}

Expand Down

0 comments on commit ac6ef87

Please sign in to comment.