File deletes

This commit is contained in:
Kilian Hofmann 2024-07-29 23:48:36 +02:00
parent f6a10c8133
commit 478f2429f5

View File

@ -593,7 +593,7 @@ class User implements JsonSerializable
// Delete old picture if it isn't a default one and if it exists.
try {
if (strpos($oldImage, "default") === false && file_exists(Config::getStorageFSPath() . $this->image)) unlink(Config::getStorageFSPath() . $oldImage);
if (strpos($oldImage, "default") === false && is_file(Config::getStorageFSPath() . $oldImage)) unlink(Config::getStorageFSPath() . $oldImage);
} catch (Exception $e) {
}
@ -624,7 +624,7 @@ class User implements JsonSerializable
// Delete picture if it isn't a default one and if it exists.
try {
if (strpos($this->image, "default") === false && file_exists(Config::getStorageFSPath() . $this->image)) unlink(Config::getStorageFSPath() . $this->image);
if (strpos($this->image, "default") === false && is_file(Config::getStorageFSPath() . $this->image)) unlink(Config::getStorageFSPath() . $this->image);
} catch (Exception $e) {
}