aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acm/acm_file.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-01-20 17:58:27 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-01-20 17:58:27 +0000
commit31e546c5e4ecd012ef9d93fa68f42c793e417303 (patch)
tree205934c32a9aff1bf4369b1f157d5d55abc1f3f6 /phpBB/includes/acm/acm_file.php
parentfae887b3a106fef9fb5828f636402d5323ba300d (diff)
downloadforums-31e546c5e4ecd012ef9d93fa68f42c793e417303.tar
forums-31e546c5e4ecd012ef9d93fa68f42c793e417303.tar.gz
forums-31e546c5e4ecd012ef9d93fa68f42c793e417303.tar.bz2
forums-31e546c5e4ecd012ef9d93fa68f42c793e417303.tar.xz
forums-31e546c5e4ecd012ef9d93fa68f42c793e417303.zip
- fixing some bugs
- removing utf8 characters from email files (has been discussed internally, you guys know why) - making sure some opendir calls are checked before calling readdir. git-svn-id: file:///svn/phpbb/trunk@6912 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acm/acm_file.php')
-rw-r--r--phpBB/includes/acm/acm_file.php30
1 files changed, 24 insertions, 6 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
index ecc4db8a89..e5ffe16d72 100644
--- a/phpBB/includes/acm/acm_file.php
+++ b/phpBB/includes/acm/acm_file.php
@@ -100,7 +100,13 @@ class acm
{
global $phpEx;
- $dir = opendir($this->cache_dir);
+ $dir = @opendir($this->cache_dir);
+
+ if (!$dir)
+ {
+ return;
+ }
+
while (($entry = readdir($dir)) !== false)
{
if (!preg_match('/^(sql_|data_(?!global))/', $entry))
@@ -115,7 +121,7 @@ class acm
@unlink($this->cache_dir . $entry);
}
}
- @closedir($dir);
+ closedir($dir);
if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
{
@@ -190,7 +196,13 @@ class acm
function purge()
{
// Purge all phpbb cache files
- $dir = opendir($this->cache_dir);
+ $dir = @opendir($this->cache_dir);
+
+ if (!$dir)
+ {
+ return;
+ }
+
while (($entry = readdir($dir)) !== false)
{
if (strpos($entry, 'sql_') !== 0 && strpos($entry, 'data_') !== 0 && strpos($entry, 'ctpl_') !== 0 && strpos($entry, 'tpl_') !== 0)
@@ -200,7 +212,7 @@ class acm
@unlink($this->cache_dir . $entry);
}
- @closedir($dir);
+ closedir($dir);
unset($this->vars);
unset($this->var_expires);
@@ -221,7 +233,13 @@ class acm
{
$regex = '(' . ((is_array($table)) ? implode('|', $table) : $table) . ')';
- $dir = opendir($this->cache_dir);
+ $dir = @opendir($this->cache_dir);
+
+ if (!$dir)
+ {
+ return;
+ }
+
while (($entry = readdir($dir)) !== false)
{
if (strpos($entry, 'sql_') !== 0)
@@ -238,7 +256,7 @@ class acm
@unlink($this->cache_dir . $entry);
}
}
- @closedir($dir);
+ closedir($dir);
return;
}