From fabe4a04f3fd75142bf55741ddb64f2ec92bfb30 Mon Sep 17 00:00:00 2001 From: Bermi Date: Sun, 27 Jul 2008 16:32:52 +0000 Subject: [PATCH] Fixing content type ordering when content_type is not defined. git-svn-id: http://svn.akelos.org/trunk@981 a2fa5c27-f921-0410-a72c-bf682d381be0 --- lib/AkActionMailer/AkMailBase.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/AkActionMailer/AkMailBase.php b/lib/AkActionMailer/AkMailBase.php index cc8ddc8..8f75118 100644 --- a/lib/AkActionMailer/AkMailBase.php +++ b/lib/AkActionMailer/AkMailBase.php @@ -431,8 +431,15 @@ class AkMailBase extends Mail function _contentTypeComparison($a, $b) { if(!isset($a->content_type) || !isset($b->content_type)){ - return 0; + if (!isset($a->content_type) && !isset($b->content_type)) { + return 0; + } else if (!isset($a->content_type)) { + return -1; + } else { + return 1; + } } + $a_ct = strtolower($a->content_type); $b_ct = strtolower($b->content_type); $a_in = in_array($a_ct, $this->_parts_order); -- 2.11.4.GIT