Fix - show the default image on non existant user
This commit is contained in:
parent
7bcd774c07
commit
b940a1226f
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user