mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-11 10:05:19 +02:00
[ticket/15342] Fix migration
PHPBB3-15342
This commit is contained in:
parent
f9c1901317
commit
a3d949c3d0
@ -15,7 +15,7 @@ namespace phpbb\db\migration\data\v330;
|
|||||||
|
|
||||||
use phpbb\storage\storage;
|
use phpbb\storage\storage;
|
||||||
|
|
||||||
class storage_track extends \phpbb\db\migration\migration
|
class storage_track extends \phpbb\db\migration\container_aware_migration
|
||||||
{
|
{
|
||||||
static public function depends_on()
|
static public function depends_on()
|
||||||
{
|
{
|
||||||
@ -74,7 +74,19 @@ class storage_track extends \phpbb\db\migration\migration
|
|||||||
|
|
||||||
while ($row = $this->db->sql_fetchrow($result))
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$storage->track_file($row['user_avatar']);
|
$avatar_group = false;
|
||||||
|
$filename = $row['user_avatar'];
|
||||||
|
|
||||||
|
if (isset($filename[0]) && $filename[0] === 'g')
|
||||||
|
{
|
||||||
|
$avatar_group = true;
|
||||||
|
$filename = substr($filename, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$ext = substr(strrchr($filename, '.'), 1);
|
||||||
|
$filename = (int) $filename;
|
||||||
|
|
||||||
|
$storage->track_file($this->config['avatar_salt'] . '_' . ($avatar_group ? 'g' : '') . $filename . '.' . $ext);
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user