Skip to content
Snippets Groups Projects
Commit 2b5dfdaf authored by Dries Buytaert's avatar Dries Buytaert
Browse files

Bugfix: when we have to extract a comment's title from the comment's body,
first strip the body's HTML tags or we might get an empty title after all.
parent a728900d
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -200,7 +200,11 @@ function comment_post($edit) {
** one from the comment's body.
*/
$edit["subject"] = strip_tags(($edit["subject"] ? $edit["subject"] : substr($edit["comment"], 0, 29)));
$edit["subject"] = strip_tags($edit["subject"]);
if ($edit["subject"] == "") {
$edit["subject"] = substr(strip_tags($edit["comment"]), 0, 29);
}
/*
** Validate the comment's body.
......
......@@ -200,7 +200,11 @@ function comment_post($edit) {
** one from the comment's body.
*/
$edit["subject"] = strip_tags(($edit["subject"] ? $edit["subject"] : substr($edit["comment"], 0, 29)));
$edit["subject"] = strip_tags($edit["subject"]);
if ($edit["subject"] == "") {
$edit["subject"] = substr(strip_tags($edit["comment"]), 0, 29);
}
/*
** Validate the comment's body.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment