diff options
-rw-r--r-- | phpBB/docs/CHANGELOG.html | 1 | ||||
-rw-r--r-- | phpBB/includes/acm/acm_file.php | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7e2e1a4663..a7c98dd417 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -123,6 +123,7 @@ <li>[Fix] Many minor and/or cosmetic fixes (Including, but not limited to: #21315, #18575, #18435, #21215)</li> <li>[Feature] New option to hide the entire list of subforums on listforums</li> <li>[Fix] Custom BBCode {EMAIL}-Token usage (Bug #21155)</li> + <li>[Fix] Do not rely on parameter returned by unlink() for verifying cache directory write permission (Bug #19565)</li> </ul> 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); } } |