mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
fix(theming): display error messages on image upload and delete previous image only after validation
Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
This commit is contained in:
parent
30d644a5a5
commit
6cfb12993e
1 changed files with 2 additions and 2 deletions
|
|
@ -202,8 +202,6 @@ class ImageManager {
|
|||
}
|
||||
|
||||
public function updateImage(string $key, string $tmpFile): string {
|
||||
$this->delete($key);
|
||||
|
||||
try {
|
||||
$folder = $this->getRootFolder()->getFolder('images');
|
||||
} catch (NotFoundException $e) {
|
||||
|
|
@ -217,6 +215,8 @@ class ImageManager {
|
|||
throw new \Exception('Unsupported image type: ' . $detectedMimeType);
|
||||
}
|
||||
|
||||
$this->delete($key);
|
||||
|
||||
if ($key === 'background') {
|
||||
if ($this->shouldOptimizeBackgroundImage($detectedMimeType, filesize($tmpFile))) {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in a new issue