indiri69 23 gadi atpakaļ
vecāks
revīzija
2d12473e69
1 mainītis faili ar 15 papildinājumiem un 15 dzēšanām
  1. 15 15
      class/mime.class.php

+ 15 - 15
class/mime.class.php

@@ -681,12 +681,12 @@ class message {
      *
      *
      */
      */
     function parseStructure($read, $i = 0) {
     function parseStructure($read, $i = 0) {
-       $arg_no = 0;
-       $arg_a = array();
-       $cnt = strlen($read);
+        $arg_no = 0;
+        $arg_a  = array();
+        $cnt    = strlen($read);
 
 
-       for (; $i < $cnt; ++$i) {
-           $char = strtoupper($read{$i});
+        for (; $i < $cnt; ++$i) {
+            $char = strtoupper($read{$i});
             switch ($char) {
             switch ($char) {
                 case '(':
                 case '(':
                     if ($arg_no == 0) {
                     if ($arg_no == 0) {
@@ -885,9 +885,9 @@ class message {
     function parseProperties($read, $i) {
     function parseProperties($read, $i) {
         $properties = array();
         $properties = array();
         $prop_name = '';
         $prop_name = '';
-        $arg_s = '';
 
 
         for (; $read{$i} != ')'; ++$i) {
         for (; $read{$i} != ')'; ++$i) {
+            $arg_s = '';
             if ($read{$i} == '"') {
             if ($read{$i} == '"') {
                 $res = $this->parseQuote($read, $i);
                 $res = $this->parseQuote($read, $i);
                 $arg_s = $res[0];
                 $arg_s = $res[0];
@@ -898,18 +898,18 @@ class message {
                 $i = $res[1];
                 $i = $res[1];
             }
             }
 
 
-            if (($prop_name == '') && $arg_s) {
-                $prop_name = strtolower($arg_s);
-                $properties[$prop_name] = '';
-                $arg_s = '';
-            } else if (($prop_name != '') && ($arg_s != '')) {
-                $properties[$prop_name] = $arg_s;
-                $prop_name = '';
-                $arg_s = '';
+            if ($arg_s != '') {
+                if ($prop_name == '') {
+                    $prop_name = strtolower($arg_s);
+                    $properties[$prop_name] = '';
+                } else if ($prop_name != '') {
+                    $properties[$prop_name] = $arg_s;
+                    $prop_name = '';
+                }
             }
             }
         }
         }
 
 
-        return (array($properties, $i));
+        return array($properties, $i);
     }
     }
 
 
     function parseEnvelope($read, $i, $hdr) {
     function parseEnvelope($read, $i, $hdr) {