Skip to content
Snippets Groups Projects
Commit a4f431ae authored by Kjartan Mannes's avatar Kjartan Mannes
Browse files

- strip HTML tags from comment subjects.

parent e8ca5acd
No related branches found
No related tags found
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
...@@ -115,7 +115,7 @@ function comment_post($edit) { ...@@ -115,7 +115,7 @@ function comment_post($edit) {
} }
else { else {
// validate subject: // validate subject:
$edit[subject] = $edit[subject] ? $edit[subject] : substr($edit[comment], 0, 29); $edit[subject] = strip_tags(($edit[subject] ? $edit[subject] : substr($edit[comment], 0, 29)));
// add watchdog entry: // add watchdog entry:
watchdog("special", "comment: added '$edit[subject]'"); watchdog("special", "comment: added '$edit[subject]'");
......
...@@ -115,7 +115,7 @@ function comment_post($edit) { ...@@ -115,7 +115,7 @@ function comment_post($edit) {
} }
else { else {
// validate subject: // validate subject:
$edit[subject] = $edit[subject] ? $edit[subject] : substr($edit[comment], 0, 29); $edit[subject] = strip_tags(($edit[subject] ? $edit[subject] : substr($edit[comment], 0, 29)));
// add watchdog entry: // add watchdog entry:
watchdog("special", "comment: added '$edit[subject]'"); watchdog("special", "comment: added '$edit[subject]'");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment