diff options
Diffstat (limited to 'phpBB/includes/acm/acm_file.php')
-rw-r--r-- | phpBB/includes/acm/acm_file.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index faa6403a2e..63eaa341f5 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -121,7 +121,7 @@ class acm @include($this->cache_dir . $entry); if ($expired) { - @unlink($this->cache_dir . $entry); + $this->remove_file($this->cache_dir . $entry); } } closedir($dir); @@ -215,7 +215,7 @@ class acm continue; } - @unlink($this->cache_dir . $entry); + $this->remove_file($this->cache_dir . $entry); } closedir($dir); @@ -273,7 +273,7 @@ class acm if ($found) { - @unlink($this->cache_dir . $entry); + $this->remove_file($this->cache_dir . $entry); } } closedir($dir); @@ -288,7 +288,7 @@ class acm if ($var_name[0] == '_') { - @unlink($this->cache_dir . 'data' . $var_name . ".$phpEx"); + $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx"); } else if (isset($this->vars[$var_name])) { @@ -351,7 +351,7 @@ class acm } else if ($expired) { - @unlink($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); + $this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); return false; } @@ -461,6 +461,18 @@ class acm return true; } + + /** + * Removes/unlinks file + */ + function remove_file($filename) + { + if (!@unlink($filename)) + { + // E_USER_ERROR - not using language entry - intended. + trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR); + } + } } ?>
\ No newline at end of file |