Eingabevalidierung #16

Merged
niklas.ortmann merged 36 commits from Beitrag-Eingabevalidierung into Beitrag-bearbeiten 2026-06-01 14:05:29 +02:00
Showing only changes of commit 268fe6a6b9 - Show all commits
+16 -9
View File
@@ -53,17 +53,21 @@ include_once 'php/controller/showArticle-controller.php';
?>
<input type="text" id="title" name="title"
value="<?php
if (isset($title) && !empty($title)){echo htmlspecialchars($title);}
if (isset($title) && !empty($title)){echo htmlspecialchars($title);
}elseif (isset($_SESSION['old_title']) && !empty($_SESSION['old_title'])){
echo htmlspecialchars($_SESSION['old_title']);
unset($_SESSION['old_title']);
}
echo htmlspecialchars($_SESSION['old_title'] ?? '');
unset($_SESSION['old_title']);
?>"
placeholder="Titel hier eingeben" required>
<textarea id="content" name="content" placeholder="Schreibe deinen Beitrag...">
<?php
if (isset($content) && !empty($content)){echo htmlspecialchars($content);}
echo htmlspecialchars($_SESSION['old_content'] ?? ''); unset($_SESSION['old_content']);
if (isset($content) && !empty($content)){echo htmlspecialchars($content);
}elseif (isset($_SESSION['old_content']) && !empty($_SESSION['old_content'])){
echo htmlspecialchars($_SESSION['old_content']);
unset($_SESSION['old_content']);
}
?>
</textarea>
</main>
@@ -124,9 +128,12 @@ include_once 'php/controller/showArticle-controller.php';
<label for="tags">Schlagwörter</label>
<input type="text" id="tags" name="tags"
value="<?php
if (isset($tags) && !empty($tags)){echo htmlspecialchars($tags);}
echo htmlspecialchars($_SESSION['old_tags'] ?? ''); unset($_SESSION['old_tags']); ?>"
if (isset($tags) && !empty($tags)){echo htmlspecialchars($tags);
} elseif (isset($_SESSION['old_tags']) && !empty($_SESSION['old_tags'])){
echo htmlspecialchars($_SESSION['old_tags']);
unset($_SESSION['old_tags']);
}
?>"
placeholder="z.B. Technik, IT (mit Komma trennen)">
</div>