All HTML tags are included in the subject when using the [comment_body] as the default subject pattern and the comment has FCKEditor on it. For example, all comment subjects start with
since the FCKEditor includes this as the first characters for it. The comment subject also includes every other HTML tag. Can it strip out all HTML tags from the comment subject.
Comments
Comment #1
fnikola commentedin my haste to resolve this issue i quickly added this code to the comment_subject.module at the bottom of the _comment_subject_get_subject function before truncating the subject to 64 characters:
this code will remove all html and bbcode tags and also set the subject to ignore any [quote] tags in the case when you are using the [comment-body] as the default subject.
Comment #2
arhak commentedusing the comment body while stripping its tags is the default Drupal behavior
if you would like to have a token with special care (sanitation?) of the body's content, you should implement a derivative version of it
$subject = substr($subject, strpos($subject, '[/quote]')+8 );note that this is very, very specific for your use case
str_replace(array('[',']'), array('<','>')lets take for instance, this comment I'm typing right now
it has square brackets right at the beginning of its body
by replacing them with angle brackets you would be converting them to tags, and afterwards stripping them
is that always desired?
is that the common/generic use case?
I guess you have the tool in your hands,
this modules offers you to use whichever token you might wan't
for this use case of yours, I guess it would fit best a customized token, provided by a module of your own
PS: correct me if I'm wrong
still open to suggestions/arguments..