show the default image on non existant user/recipe
This commit is contained in:
parent
02a53db50c
commit
7b546cd565
@ -80,19 +80,13 @@ final class RecipeController
|
|||||||
$O_recipeModel = new RecipeModel();
|
$O_recipeModel = new RecipeModel();
|
||||||
$A_recipe = $O_recipeModel->getRecipeByID($A_urlParams[0]);
|
$A_recipe = $O_recipeModel->getRecipeByID($A_urlParams[0]);
|
||||||
|
|
||||||
if (!isset($A_recipe)) {
|
|
||||||
throw new HTTPSpecialCaseException(404);
|
|
||||||
}
|
|
||||||
|
|
||||||
header("Content-Type: image");
|
header("Content-Type: image");
|
||||||
if ($A_recipe["IMG"] === null) {
|
if (isset($A_recipe) && $A_recipe["IMG"] !== null) {
|
||||||
echo file_get_contents(Constants::rootDir()."/static/img/default_recipe.jpg");
|
|
||||||
} else {
|
|
||||||
echo $A_recipe["IMG"];
|
echo $A_recipe["IMG"];
|
||||||
|
} else {
|
||||||
|
echo file_get_contents(Constants::rootDir()."/static/img/default_recipe.jpg");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return Utils::RETURN_RAW;
|
return Utils::RETURN_RAW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user