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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek’s picture

Component: Miscellaneous » Code
Status: Active » Needs review
FileSize
1.7 KB

Patch is attached! Please let me know what you think.

Dane Powell’s picture

Status: Needs review » Fixed
dsnopek’s picture

Thanks for the super fast commit! :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.