Compare commits

...

3 Commits

Author SHA1 Message Date
niklas.ortmann a88f8ca638 Update updateArticle-controller.php 2026-06-14 22:12:12 +02:00
niklas.ortmann be6a5f9add Update article-validator.php 2026-06-14 22:12:10 +02:00
niklas.ortmann ed4498578d Update alertMessages.php 2026-06-14 22:10:13 +02:00
3 changed files with 1 additions and 18 deletions
+1 -1
View File
@@ -15,7 +15,7 @@
<?php endif; ?> <?php endif; ?>
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "invalid_content"): ?> <?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "invalid_content"): ?>
<p class="alert-message is-error"> <p class="alert-message is-error">
Der Text- und Bildblock dürfen nicht leer sein! Ein Beitrag muss Inhalt besitzen. Text- und Bildelemente dürfen nicht leer sein!
</p> </p>
<?php endif; ?> <?php endif; ?>
<?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "invalid_category"): ?> <?php if (isset($_SESSION["message"]) && $_SESSION["message"] == "invalid_category"): ?>
@@ -34,12 +34,6 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$tags = $_POST['tags'] ?? ''; $tags = $_POST['tags'] ?? '';
// -------------------------------- Validierung der Daten: ------------------------- // -------------------------------- Validierung der Daten: -------------------------
if (!articleAuthorValidator($author)) {
$_SESSION["message"] = "author_not_valid";
header("location: ../../index.php?pfad=updateArticle&id=$id");
exit();
}
if (!articleTitleValidator($title)) { if (!articleTitleValidator($title)) {
$_SESSION["message"] = "invalid_title"; $_SESSION["message"] = "invalid_title";
header("location: ../../index.php?pfad=updateArticle&id=$id"); header("location: ../../index.php?pfad=updateArticle&id=$id");
-11
View File
@@ -1,16 +1,5 @@
<?php <?php
/**
* Prüft, ob der Autor auch der Eigentümer des Beitrags ist.
* @param $author
* @return true
* TODO: Implement this.
*/
function articleAuthorValidator($author)
{
return true;
}
/** /**
* Prüft, ob der Titel die folgenden Bedingungen erfüllt: * Prüft, ob der Titel die folgenden Bedingungen erfüllt:
* Buchstaben von a-z; A-Z * Buchstaben von a-z; A-Z