do not call queryImg() twice

This commit is contained in:
Thomas Rubini 2023-01-25 16:50:05 +01:00
parent 7baf1bdcf3
commit 112f4daf81
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -85,13 +85,15 @@ final class RecipeController
$O_recipe = RecipeModel::getRecipeByID($A_urlParams[0]);
header("Content-Type: image");
if (isset($O_recipe) && $O_recipe->queryImg() !== null) {
echo $O_recipe->queryImg();
} else {
echo file_get_contents(Constants::rootDir()."/static/img/default_recipe.jpg");
if (isset($O_recipe)) {
$S_img = $O_recipe->queryImg();
if ($S_img !== null) {
echo $S_img;
return Utils::RETURN_RAW;
}
}
echo file_get_contents(Constants::rootDir()."/static/img/default_recipe.jpg");
return Utils::RETURN_RAW;
}
}