I' m using a smiley module. I have entered ':)' as comment body. After all filters are done, ':)' will be replaced with
<p><img class="smiley" src="/emoticon/smile.gif" width="24" height="24" title="Smiling" alt="Smiling" /></p>
Nice.
And the following code will make us a zero-length code due to strip_tags magic.
if (trim($form_values['subject']) == '') {
// The body may be in any format, so we:
// 1) Filter it into HTML
// 2) Strip out all HTML tags
// 3) Convert entities back to plain-text.
// Note: format is checked by check_markup().
$form_values['subject'] = truncate_utf8(decode_entities(strip_tags(check_markup($form_values['comment'], $form_values['format']))), 29, TRUE);
}
return $form_values;
}
Well. I know you can say - its smileys issue. But I think ot only smiley, even some full-working module can break Drupal functionality in such a way.
The solution: the best I think is to ask user to enter a comment title, 'cos it can't be automattically generated.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | comment_subject_0.patch | 1.13 KB | Zen |
| #8 | comment_subject.patch | 1.13 KB | Zen |
Comments
Comment #1
webchickCritical?
Sorry, I don't think so.
Comment #2
Zen commentedThis is a module issue or you can make a feature request to have a "required" option in the comment configuration page for comment subjects (which would be nice).
Marking as a feature request.
Thanks
-K
Comment #3
doq commentedtry to post <p></p> and you'll see comment with no title. No external modules, just default input format.
I can develop patch if anybody interesting in fixing this.
Comment #4
magico commentedI posted the following comment
It generates the following title:
this should create aComment #5
webchickNo, not
<p>...</p>, but<p></p>.Comment #6
magico commentedIf we post
We get a title
text after more moreIt's normal that if we only put some empty tags in HTML they will not show up. If we do not want to allow these kind of posts then look here http://drupal.org/node/67348
Comment #7
Zen commented@doq: Please submit a patch for this (that validates the subject rather than make the subject mandatory) - thanks :) I'll be happy to review it.
Cheers,
-K
Comment #8
Zen commentedPatch attached.
-K
Comment #9
Zen commentedPatch attached.
-K
Comment #10
killes@www.drop.org commentedmoving
Comment #11
Steven commentedCommitted a slightly different patch to head, using
t('No subject')instead of message_na(), which was removed.Comment #12
killes@www.drop.org commentedbackported
Comment #13
(not verified) commented