1
0
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:
Ruben Calvo
2024-12-24 19:30:05 +01:00
parent d6953a0422
commit b33f17e7ce
7 changed files with 86 additions and 38 deletions

View File

@@ -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);
}
}
}