This function assumes that it's being run on a feed fetched via Mailhandler, but never actually checks that this is so. This means that on all other feeds (at best) the $message['body_html']
key that it's using will be undefined (leading to PHP notices).
However, there is no guarantee that $message
is even an array! It appears that the Feed parser from date_ical actually uses an object for $result->items
, which leads to fatal errors:
Cannot use object of type DateIcalIcalcreatorComponent as array
This last bit could also be a bug in date_ical. But, regardless if it is or not, mailcomment really shouldn't be trying to mess with all feeds, just those from Mailhandler. I think the body of the mailcomment_feeds_after_parse()
function should be wrapped in some kind of if (..) { ... }
statement.
Comment | File | Size | Author |
---|---|---|---|
#1 | mailcomment-hook_feeds_after_parse-2198531-1.patch | 1.7 KB | dsnopek |
Comments
Comment #1
dsnopekPatch is attached! Please let me know what you think.
Comment #2
Dane Powell CreditAttribution: Dane Powell commentedThanks for the find, and especially for the patch.
http://drupalcode.org/project/mailcomment.git/commit/2a7b526
http://drupalcode.org/project/mailcomment.git/commit/899b3c9
Comment #3
dsnopekThanks for the super fast commit! :-)