Checking existence for an array element on a string will always evaluate to 'true' -
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 17 Jan 2009 22:08:39 +0000 (17:08 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 17 Jan 2009 22:09:45 +0000 (17:09 -0500)
need to add additional checks for an array here as well.

framework/Mime/lib/Horde/Mime.php

index a0dcfa0..f201be6 100644 (file)
@@ -209,8 +209,8 @@ class Horde_Mime
         $text = '';
         foreach ($addresses as $addr) {
             // Check for groups.
-            if (empty($addr['groupname'])) {
-                if (empty($addr['personal'])) {
+            if (!is_array($addr) || (is_array($addr) && empty($addr['groupname']))) {
+                if (!is_array($addr) || (is_array($addr) && empty($addr['personal']))) {
                     $personal = '';
                 } else {
                     if (($addr['personal'][0] == '"') &&