Skip to content

Commit

Permalink
Fixed the wrong return value of cache_clean_directories()
Browse files Browse the repository at this point in the history
  • Loading branch information
mystralkk committed Sep 4, 2022
1 parent 8f28db3 commit fdbd12f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system/classes/template.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2142,19 +2142,19 @@ public function check_instance($iid, $fileVar)
* @param string $needle String matched against cache filenames
* @param int $since
* @access private
* @return int number of files not deleted
* @return int number of files NOT deleted
*/
function cache_clean_directories($path, $needle = '', $since = 0)
{
global $_CONF;

$lockFile = $_CONF['path_data'] . 'cache' . DIRECTORY_SEPARATOR . Template::LOCK_FILE;
if (is_readable($lockFile)) {
return 0;
return -1;
}

if (!@touch($lockFile)) {
return 0;
return -1;
}

$numFiles = 0;
Expand Down

0 comments on commit fdbd12f

Please sign in to comment.