code cleanup
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Sep 2002 15:40:08 +0000 (15:40 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Sep 2002 15:40:08 +0000 (15:40 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3532 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/mime/Message.class.php

index dfa6ba0..e2dc981 100644 (file)
@@ -209,9 +209,7 @@ class Message {
                         case 3:
                             if (isset($msg->type0) && ($msg->type0 == 'multipart')) {
                                 ++$i;
                         case 3:
                             if (isset($msg->type0) && ($msg->type0 == 'multipart')) {
                                 ++$i;
-                                $res= $msg->parseLanguage($read, $i);
-                                $arg_a[] = $res[0];
-                                $i = $res[1];
+                                $arg_a[]= $msg->parseLanguage($read, $i);
                             }
                         case 7:
                             if (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822')) {
                             }
                         case 7:
                             if (($arg_a[0] == 'message') && ($arg_a[1] == 'rfc822')) {
@@ -220,9 +218,7 @@ class Message {
                                 $msg->type0 = $arg_a[0];
                                 $msg->type1 = $arg_a[1];
                                 $rfc822_hdr = new Rfc822Header();
                                 $msg->type0 = $arg_a[0];
                                 $msg->type1 = $arg_a[1];
                                 $rfc822_hdr = new Rfc822Header();
-                                $res = $msg->parseEnvelope($read, $i, $rfc822_hdr);
-                                $msg->rfc822_header = $res[0];
-                                $i = $res[1] + 1;
+                                $msg->rfc822_header = $msg->parseEnvelope($read, $i, $rfc822_hdr);
                                 while (($i < $cnt) && ($read{$i} != '(')) {
                                     ++$i;
                                 }
                                 while (($i < $cnt) && ($read{$i} != '(')) {
                                     ++$i;
                                 }
@@ -371,7 +367,7 @@ class Message {
         return $properties;
     }
 
         return $properties;
     }
 
-    function parseEnvelope($read, $i, $hdr) {
+    function parseEnvelope($read, &$i, $hdr) {
         $arg_no = 0;
         $arg_a = array();
 
         $arg_no = 0;
         $arg_a = array();
 
@@ -405,9 +401,7 @@ class Message {
                     $a=0;
                     for (; $i < $cnt && $read{$i} != ')'; ++$i) {
                         if ($read{$i} == '(') {
                     $a=0;
                     for (; $i < $cnt && $read{$i} != ')'; ++$i) {
                         if ($read{$i} == '(') {
-                            $res = $this->parseAddress($read, $i);
-                            $addr = $res[0];
-                            $i = $res[1];
+                            $addr = $this->parseAddress($read, $i);
                             if (($addr->host == '') && ($addr->mailbox != '')) {
                                 /* start of group */
                                 $group = $addr->mailbox;
                             if (($addr->host == '') && ($addr->mailbox != '')) {
                                 /* start of group */
                                 $group = $addr->mailbox;
@@ -454,7 +448,7 @@ class Message {
             $hdr->inreplyto = $arg_a[8];   /* argument 9: in-reply-to */
             $hdr->message_id = $arg_a[9];  /* argument 10: message-id */
         }
             $hdr->inreplyto = $arg_a[8];   /* argument 9: in-reply-to */
             $hdr->message_id = $arg_a[9];  /* argument 10: message-id */
         }
-        return (array($hdr, $i));
+        return $hdr;
     }
 
     function parseLiteral($read, &$i) {
     }
 
     function parseLiteral($read, &$i) {
@@ -482,7 +476,7 @@ class Message {
         return $s;
     }
 
         return $s;
     }
 
-    function parseAddress($read, $i) {
+    function parseAddress($read, &$i) {
         $arg_a = array();
 
         for (; $read{$i} != ')'; ++$i) {
         $arg_a = array();
 
         for (; $read{$i} != ')'; ++$i) {
@@ -512,7 +506,7 @@ class Message {
         } else {
             $adr = '';
         }
         } else {
             $adr = '';
         }
-        return (array($adr, $i));
+        return $adr;
     }
 
     function parseDisposition($read, &$i) {
     }
 
     function parseDisposition($read, &$i) {