mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
Update AvatarController
This commit is contained in:
parent
3603913f2a
commit
6644c69366
1 changed files with 16 additions and 1 deletions
|
@ -73,7 +73,7 @@ class AvatarController extends Controller
|
|||
|
||||
public function buildPath($id)
|
||||
{
|
||||
$padded = str_pad($id, 12, 0, STR_PAD_LEFT);
|
||||
$padded = str_pad($id, 19, 0, STR_PAD_LEFT);
|
||||
$parts = str_split($padded, 3);
|
||||
foreach ($parts as $k => $part) {
|
||||
if ($k == 0) {
|
||||
|
@ -93,6 +93,21 @@ class AvatarController extends Controller
|
|||
$prefix = storage_path('app/'.$avatarpath);
|
||||
$this->checkDir($prefix);
|
||||
}
|
||||
if ($k == 4) {
|
||||
$avatarpath = 'public/avatars/'.$parts[0].'/'.$parts[1].'/'.$parts[2].'/'.$parts[3].'/'.$parts[4];
|
||||
$prefix = storage_path('app/'.$avatarpath);
|
||||
$this->checkDir($prefix);
|
||||
}
|
||||
if ($k == 5) {
|
||||
$avatarpath = 'public/avatars/'.$parts[0].'/'.$parts[1].'/'.$parts[2].'/'.$parts[3].'/'.$parts[4].'/'.$parts[5];
|
||||
$prefix = storage_path('app/'.$avatarpath);
|
||||
$this->checkDir($prefix);
|
||||
}
|
||||
if ($k == 6) {
|
||||
$avatarpath = 'public/avatars/'.$parts[0].'/'.$parts[1].'/'.$parts[2].'/'.$parts[3].'/'.$parts[4].'/'.$parts[5].'/'.$parts[6];
|
||||
$prefix = storage_path('app/'.$avatarpath);
|
||||
$this->checkDir($prefix);
|
||||
}
|
||||
}
|
||||
|
||||
return $avatarpath;
|
||||
|
|
Loading…
Reference in a new issue