array_key_exists() only exists in PHP 4 >= 4.1.0
authorindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 7 Sep 2002 21:44:10 +0000 (21:44 +0000)
committerindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 7 Sep 2002 21:44:10 +0000 (21:44 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3612 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php

index 3ad32e0..c8965d2 100644 (file)
@@ -118,39 +118,39 @@ function getforwardHeader($orig_header) {
  */
 //$session_expired = false; 
 if (session_is_registered('session_expired_post')) {
-   global $session_expired_post, $session_expired;
-   /* 
-    * extra check for username so we don't display previous post data from
-    * another user during this session.
-    */
-   if ($session_expired_post['username'] != $username) {
-      session_unregister('session_expired_post');
-      session_unregister('session_expired');      
-   } else {
-      foreach ($session_expired_post as $postvar => $val) {
-         if (isset($val)) {
-            $$postvar = $val;
-         } else {
-            $$postvar = '';
-         }
-      }
-      if (isset($send)) {
-         unset($send);
-      }
-      $session_expired = true;
-   }
-   session_unregister('session_expired_post');
-   session_unregister('session_expired');
-   if (!isset($mailbox)) {
-      $mailbox = '';
-   }
-   if ($compose_new_win == '1') {
-      compose_Header($color, $mailbox);
-   } else {
-      displayPageHeader($color, $mailbox);
-   }
-   showInputForm($session, false);
-   exit();
+    global $session_expired_post, $session_expired;
+    /* 
+     * extra check for username so we don't display previous post data from
+     * another user during this session.
+     */
+    if ($session_expired_post['username'] != $username) {
+        session_unregister('session_expired_post');
+        session_unregister('session_expired');      
+    } else {
+        foreach ($session_expired_post as $postvar => $val) {
+            if (isset($val)) {
+                $$postvar = $val;
+            } else {
+                $$postvar = '';
+            }
+        }
+        if (isset($send)) {
+            unset($send);
+        }
+        $session_expired = true;
+    }
+    session_unregister('session_expired_post');
+    session_unregister('session_expired');
+    if (!isset($mailbox)) {
+        $mailbox = '';
+    }
+    if ($compose_new_win == '1') {
+        compose_Header($color, $mailbox);
+    } else {
+        displayPageHeader($color, $mailbox);
+    }
+    showInputForm($session, false);
+    exit();
 }
 
 if (!isset($attachments)) {
@@ -172,7 +172,8 @@ if (!isset($session) || (isset($newmessage) && $newmessage)) {
 if (!isset($compose_messages)) {
   $compose_messages = array();
 }
-if (!array_key_exists($session, $compose_messages)) {
+if (!isset($compose_messages[$session]) || ($compose_messages[$session] == NULL)) {
+/* if (!array_key_exists($session, $compose_messages)) {  /* We can only do this in PHP >= 4.1 */
   $composeMessage = new message();
   $rfc822_header = new Rfc822Header();
   $composeMessage->rfc822_header = $rfc822_header;