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