Fix - show the default image on non existant user

This commit is contained in:
Thomas Rubini 2023-01-24 18:26:07 +01:00
parent 7bcd774c07
commit b940a1226f
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -197,19 +197,14 @@ final class UserController
$O_userModel = new UserModel();
$A_user = $O_userModel->getUserByID($A_urlParams[0]);
if (!isset($A_user)) {
throw new HTTPSpecialCaseException(404);
}
if ($A_user["PROFILE_PIC"] === null) {
header("Content-Type: image/svg+xml");
echo file_get_contents(Constants::rootDir()."/static/img/default_user.svg");
} else {
if (isset($A_user) && $A_user["PROFILE_PIC"] !== null) {
header("Content-Type: image");
echo $A_user["PROFILE_PIC"];
} else {
header("Content-Type: image/svg+xml");
echo file_get_contents(Constants::rootDir()."/static/img/default_user.svg");
}
return Utils::RETURN_RAW;
}