From b883ff119f4e42fbc967a6b1971af2198762fbd8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 3 Jul 2007 15:36:18 +0000 Subject: let's see if i can break something. :o git-svn-id: file:///svn/phpbb/trunk@7830 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acm/acm_file.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/acm') 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 -- cgit v1.2.1