Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 62a7b6773c | |||
| 625dd35b9e | |||
| f99b7bc8ab |
@@ -2,12 +2,14 @@
|
||||
session_start();
|
||||
require_once '../model/LocalArticleManager.php';
|
||||
require_once '../model/ArticleManager.php';
|
||||
require_once '../validator/article-validator.php';
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
$_SESSION["old_title"] = $_POST["title"] ?? '';
|
||||
$_SESSION["old_content"] = $_POST["content"] ?? '';
|
||||
$_SESSION["old_category"] = $_POST["category"] ?? '';
|
||||
$_SESSION["old_tags"] = $_POST["tags"] ?? '';
|
||||
|
||||
if(!isset($_POST["title"]) ||!isset($_POST["content"]) || !isset($_POST["category"])){
|
||||
$_SESSION["message"] = "missing_parameters";
|
||||
header("location: ../../index.php?pfad=createArticle");
|
||||
|
||||
@@ -28,11 +28,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
$content = $_POST["content"];
|
||||
$author = "max.mustermann"; // TODO: später aus Session den angemeldeten Nutzer beziehen.
|
||||
$category = $_POST["category"];
|
||||
if (isset($_POST['tags'])) {
|
||||
$tags = $_POST['tags'];
|
||||
} else {
|
||||
$tags = '';
|
||||
}
|
||||
$tags = $_POST['tags'] ?? '';
|
||||
|
||||
// -------------------------------- Validierung der Daten: -------------------------
|
||||
if (!articleAuthorValidator($author)) {
|
||||
|
||||
Reference in New Issue
Block a user