Fix undefined field problem
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 30 Jan 2008 07:37:17 +0000 (07:37 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 30 Jan 2008 07:37:17 +0000 (07:37 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12907 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php

index 19ce2d7..e7df007 100755 (executable)
@@ -231,7 +231,9 @@ function get_squirrel_sort($imap_stream, $sSortField, $reverse = false, $aUid =
 
     // sqimap_get_small_header (see above) returns fields in lower case,
     // but the code below uses all upper case
-    foreach ($msgs as $k => $v) $msgs[$k][strtoupper($sSortField)] = $msgs[$k][strtolower($sSortField)];
+    foreach ($msgs as $k => $v) 
+        if (isset($msgs[$k][strtolower($sSortField)])) 
+            $msgs[$k][strtoupper($sSortField)] = $msgs[$k][strtolower($sSortField)];
 
     $aUid = array();
     $walk = false;