Skip to content

Commit

Permalink
CRM-9484. Gracefully handle unrecognised message part types.
Browse files Browse the repository at this point in the history
  • Loading branch information
xurizaemon committed Aug 15, 2016
1 parent 6a4eebc commit 4315599
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions CRM/Utils/Mail/Incoming.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function formatMailPart($part, &$attachments) {
return NULL;
}

CRM_Core_Error::fatal(ts("No clue about the %1", array(1 => get_class($part))));
return self::formatMailUnrecognisedPart($part);
}

/**
Expand Down Expand Up @@ -126,7 +126,7 @@ public function formatMailMultipart($part, &$attachments) {
return self::formatMailDeliveryStatus($part);
}

CRM_Core_Error::fatal(ts("No clue about the %1", array(1 => get_class($part))));
return self::formatMailUnrecognisedPart($part);
}

/**
Expand Down Expand Up @@ -248,6 +248,15 @@ public function formatMailDeliveryStatus($part) {
return $t;
}

/**
* @param $part
*
* @return string
*/
public function formatUnrecognisedPart($part) {
return ts('Unrecognised message part of type "%1".', array('%1' => get_class($part)));
}

/**
* @param $part
* @param $attachments
Expand Down

0 comments on commit 4315599

Please sign in to comment.