Do not trust case of get_class() return string
[squirrelmail.git] / functions / imap_messages.php
index 62a658f60c7b61c252b1b75b2d9f207e439da68e..74a2448542e48d22739432351bd13cccfae71f4a 100755 (executable)
@@ -954,7 +954,7 @@ function sqimap_get_message($imap_stream, $id, $mailbox, $hide=0) {
  */
 function parse_message_entities(&$msg, $id, $imap_stream) {
     if (!empty($msg->entities)) foreach ($msg->entities as $i => $entity) {
-        if (is_object($entity) && get_class($entity) == 'Message') {
+        if (is_object($entity) && strtolower(get_class($entity)) == 'message') {
             if (!empty($entity->rfc822_header)) {
                 $read = sqimap_run_command($imap_stream, "FETCH $id BODY[". $entity->entity_id .".HEADER]", true, $response, $message, TRUE);
                 $rfc822_header = new Rfc822Header();