Fehlermeldungsweiterleitung setzt nun die id
This commit is contained in:
@@ -33,31 +33,31 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
|||||||
// -------------------------------- Validierung der Daten: -------------------------
|
// -------------------------------- Validierung der Daten: -------------------------
|
||||||
if (!articleAuthorValidator($author)) {
|
if (!articleAuthorValidator($author)) {
|
||||||
$_SESSION["message"] = "author_not_valid";
|
$_SESSION["message"] = "author_not_valid";
|
||||||
header("location: ../../index.php?pfad=updateArticle");
|
header("location: ../../index.php?pfad=updateArticle&id=$id");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!articleTitleValidator($title)) {
|
if (!articleTitleValidator($title)) {
|
||||||
$_SESSION["message"] = "invalid_title";
|
$_SESSION["message"] = "invalid_title";
|
||||||
header("location: ../../index.php?pfad=updateArticle");
|
header("location: ../../index.php?pfad=updateArticle&id=$id");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!articleContentValidator($content)) {
|
if (!articleContentValidator($content)) {
|
||||||
$_SESSION["message"] = "invalid_content";
|
$_SESSION["message"] = "invalid_content";
|
||||||
header("location: ../../index.php?pfad=updateArticle");
|
header("location: ../../index.php?pfad=updateArticle&id=$id");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!articleCategoryValidator($category)) {
|
if (!articleCategoryValidator($category)) {
|
||||||
$_SESSION["message"] = "invalid_category";
|
$_SESSION["message"] = "invalid_category";
|
||||||
header("location: ../../index.php?pfad=updateArticle");
|
header("location: ../../index.php?pfad=updateArticle&id=$id");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!articleTagValidator($tags)) {
|
if (!articleTagValidator($tags)) {
|
||||||
$_SESSION["message"] = "invalid_tags";
|
$_SESSION["message"] = "invalid_tags";
|
||||||
header("location: ../../index.php?pfad=updateArticle");
|
header("location: ../../index.php?pfad=updateArticle&id=$id");
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
$cleanedTags = [];
|
$cleanedTags = [];
|
||||||
@@ -83,7 +83,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
|||||||
$articleManager->updateArticle($id ,$article, $author);
|
$articleManager->updateArticle($id ,$article, $author);
|
||||||
} catch (Exception $e){
|
} catch (Exception $e){
|
||||||
$_SESSION["message"] = $e->getMessage();
|
$_SESSION["message"] = $e->getMessage();
|
||||||
header("location: ../../index.php?pfad=updateArticle=$id");
|
header("location: ../../index.php?pfad=updateArticle&id=$id");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$_SESSION["message"] = "article_updated";
|
$_SESSION["message"] = "article_updated";
|
||||||
|
|||||||
Reference in New Issue
Block a user