mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/15692] Don't try to track files that don't exist
PHPBB3-15692
This commit is contained in:
parent
4734e56b5b
commit
212882fe70
1 changed files with 33 additions and 4 deletions
|
@ -86,8 +86,15 @@ class storage_track extends \phpbb\db\migration\container_aware_migration
|
|||
$ext = substr(strrchr($filename, '.'), 1);
|
||||
$filename = (int) $filename;
|
||||
|
||||
try
|
||||
{
|
||||
$storage->track_file($this->config['avatar_salt'] . '_' . ($avatar_group ? 'g' : '') . $filename . '.' . $ext);
|
||||
}
|
||||
catch (\phpbb\storage\exception\exception $e)
|
||||
{
|
||||
// If file don't exist, don't track it
|
||||
}
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
|
@ -102,13 +109,27 @@ class storage_track extends \phpbb\db\migration\container_aware_migration
|
|||
$result = $this->db->sql_query($sql);
|
||||
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
try
|
||||
{
|
||||
$storage->track_file($row['physical_filename']);
|
||||
}
|
||||
catch (\phpbb\storage\exception\exception $e)
|
||||
{
|
||||
// If file don't exist, don't track it
|
||||
}
|
||||
|
||||
if ($row['thumbnail'] == 1)
|
||||
{
|
||||
try
|
||||
{
|
||||
$storage->track_file('thumb_' . $row['physical_filename']);
|
||||
}
|
||||
catch (\phpbb\storage\exception\exception $e)
|
||||
{
|
||||
// If file don't exist, don't track it
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->db->sql_freeresult($result);
|
||||
}
|
||||
|
@ -124,9 +145,17 @@ class storage_track extends \phpbb\db\migration\container_aware_migration
|
|||
$result = $this->db->sql_query($sql);
|
||||
|
||||
while ($row = $this->db->sql_fetchrow($result))
|
||||
{
|
||||
try
|
||||
{
|
||||
$storage->track_file($row['filename']);
|
||||
}
|
||||
catch (\phpbb\storage\exception\exception $e)
|
||||
{
|
||||
// If file don't exist, don't track it
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue