aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acm/acm_file.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acm/acm_file.php')
-rw-r--r--phpBB/includes/acm/acm_file.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
index 775e8d4495..5851016f3d 100644
--- a/phpBB/includes/acm/acm_file.php
+++ b/phpBB/includes/acm/acm_file.php
@@ -312,7 +312,7 @@ class acm
if ($var_name[0] == '_')
{
- $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx");
+ $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx", true);
}
else if (isset($this->vars[$var_name]))
{
@@ -375,7 +375,7 @@ class acm
}
else if ($expired)
{
- $this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx");
+ $this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx", true);
return false;
}
@@ -489,13 +489,15 @@ class acm
/**
* Removes/unlinks file
*/
- function remove_file($filename)
+ function remove_file($filename, $check = false)
{
- if (!@unlink($filename))
+ if ($check && !@is_writeable($this->cache_dir))
{
// 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);
}
+
+ return @unlink($filename);
}
}