Update createArticle-controller.php
This commit is contained in:
@@ -60,11 +60,12 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
header("location: ../../index.php?pfad=createArticle");
|
||||
exit();
|
||||
}
|
||||
$validatedCategory = $category;
|
||||
echo "Kategorievalidierung erfolgreich";
|
||||
|
||||
// -------------------------- Eingabevalidierung der tags: ----------------------
|
||||
if (isset($_POST['tags'])) {
|
||||
$tags = trim($_POST['tags']);
|
||||
$tags = $_POST['tags'];
|
||||
} else {
|
||||
$tags = '';
|
||||
}
|
||||
@@ -96,8 +97,10 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
echo "Tagvalidierung erfolgreich";
|
||||
|
||||
// ----------------- Übertragung der validierten Daten in ArticleManager: ---------------------------
|
||||
if (!isset($validatedTitle) || !isset($validatedContent) || !isset($validatedCategory) || !isset($validatedTags)) {
|
||||
if (!isset($validatedTitle) || !isset($validatedContent) || !isset($validatedAuthor) || !isset($validatedCategory) || !isset($validatedTags)) {
|
||||
$_SESSION["message"] = "validation_missing";
|
||||
header("location: ../../index.php?pfad=createArticle");
|
||||
exit();
|
||||
} else {
|
||||
try {
|
||||
$articleManager = ArticleManager::getInstance();
|
||||
|
||||
Reference in New Issue
Block a user