Skip to content

Commit

Permalink
Consolidate conditionals for zero-byte advanced-cache.php bug
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Mar 14, 2015
1 parent 3630f6d commit 8d2de34
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions zencache-pro/zencache-pro.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -2769,16 +2769,13 @@ public function check_advanced_cache()
return; // Skip on plugin actions.

$cache_dir = $this->cache_dir(); // Current cache directory.

if(!is_file($cache_dir.'/zc-advanced-cache'))
$this->add_advanced_cache();

$advanced_cache_file = WP_CONTENT_DIR.'/advanced-cache.php';

// Fixes zero-byte advanced-cache.php bug related to migrating from Quick Cache
// See https://github.com/websharks/zencache/issues/432
if(!is_file($advanced_cache_file) || filesize($advanced_cache_file) === 0)
$this->add_advanced_cache();
if(!is_file($cache_dir.'/zc-advanced-cache')
|| !is_file($advanced_cache_file) || filesize($advanced_cache_file) === 0
) $this->add_advanced_cache();
}

/**
Expand Down

0 comments on commit 8d2de34

Please sign in to comment.