Commit 8b2d04f3 authored by drumm's avatar drumm

#395086 by Freso: call trim() before truncate_utf8() in comment module for...

#395086 by Freso: call trim() before truncate_utf8() in comment module for better quality truncation.
parent d930ca09
......@@ -1656,7 +1656,7 @@ function _comment_form_submit($form_values) {
// 2) Strip out all HTML tags
// 3) Convert entities back to plain-text.
// Note: format is checked by check_markup().
$form_values['subject'] = trim(truncate_utf8(decode_entities(strip_tags(check_markup($form_values['comment'], $form_values['format']))), 29, TRUE));
$form_values['subject'] = truncate_utf8(trim(decode_entities(strip_tags(check_markup($form_values['comment'], $form_values['format'])))), 29, TRUE);
// Edge cases where the comment body is populated only by HTML tags will
// require a default subject.
if ($form_values['subject'] == '') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment