Compare commits
2 Commits
v2026.2.0-
...
v2026.2.0-
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d6aff8d90 | |||
| 15ba26ccf2 |
@@ -216,7 +216,7 @@ POSTGRES_VERSION=18
|
||||
MINIO_ROOT_USER=mineseeker
|
||||
MINIO_ROOT_PASSWORD="<strong password>"
|
||||
MINIO_ENDPOINT=http://minio:9000
|
||||
MINIO_PUBLIC_URL=https://minio.mineseeker.hu
|
||||
MINIO_PUBLIC_URL=https://aws.mineseeker.hu
|
||||
|
||||
MAILER_DSN=smtp://mail:25?verify_peer=0
|
||||
MAIL_DOMAIN=mineseeker.hu
|
||||
|
||||
@@ -19,6 +19,7 @@ use Liip\ImagineBundle\Imagine\Cache\CacheManager;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -228,16 +229,14 @@ class ProfileController extends AbstractController
|
||||
}
|
||||
|
||||
$ext = $file->guessExtension() ?? 'jpg';
|
||||
$newPath = sprintf('avatar/%d.%s', $user->getId(), $ext);
|
||||
$newPath = sprintf('avatar/%s.%s', Uuid::v4()->toRfc4122(), $ext);
|
||||
$oldPath = $user->getAvatarPath();
|
||||
|
||||
// Remove old file and any cached thumbnails
|
||||
if ($oldPath) {
|
||||
if ($oldPath !== $newPath) {
|
||||
try {
|
||||
$mediaStorage->delete($oldPath);
|
||||
} catch (\Throwable) {
|
||||
}
|
||||
try {
|
||||
$mediaStorage->delete($oldPath);
|
||||
} catch (\Throwable) {
|
||||
}
|
||||
$cacheManager->remove($oldPath, 'avatar_thumb');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user