mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 04:04:12 +02:00
[ticket/17361] Use filesystem classes for tempnam and temp dir. Code reviews.
PHPBB-17361
This commit is contained in:
@@ -36,11 +36,11 @@ class storage_backup_data extends migration
|
||||
$methods = ['sql', 'sql.gz', 'sql.bz2'];
|
||||
|
||||
$dir = $this->phpbb_root_path . 'store/';
|
||||
$dh = @opendir($dir);
|
||||
$handle = @opendir($dir);
|
||||
|
||||
if ($dh)
|
||||
if ($handle)
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
while (($file = readdir($handle)) !== false)
|
||||
{
|
||||
if (preg_match('#^backup_(\d{10,})_(?:[a-z\d]{16}|[a-z\d]{32})\.(sql(?:\.(?:gz|bz2))?)$#i', $file, $matches))
|
||||
{
|
||||
@@ -58,7 +58,7 @@ class storage_backup_data extends migration
|
||||
|
||||
}
|
||||
|
||||
closedir($dh);
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user