fix avatar path for subdirectory installations (#1201)

This commit is contained in:
Kevin Papst
2019-10-30 14:00:48 +01:00
committed by GitHub
parent bda9584346
commit 48aefb1862
4 changed files with 7 additions and 7 deletions

View File

@@ -110,14 +110,14 @@ class AvatarService
private function getAvatarUrl(User $profile): string
{
return '/avatars/' . md5($profile->getId() . '_' . $profile->getDisplayName()) . '.png';
return md5($profile->getId() . '_' . $profile->getDisplayName()) . '.png';
}
private function getImagePath(User $profile): string
{
$avatarPath = realpath($this->projectDirectory . '/public/');
$avatarPath = realpath($this->projectDirectory . '/public/avatars/');
return $avatarPath . $this->getAvatarUrl($profile);
return $avatarPath . '/' . $this->getAvatarUrl($profile);
}
public function generateAvatar(User $profile, bool $regenerate = false): bool