]> git.andy128k.dev Git - ipf-mail.git/commitdiff
minor code simplifications
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 10 Aug 2013 08:55:59 +0000 (11:55 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 10 Aug 2013 08:55:59 +0000 (11:55 +0300)
mail/protocol/imap.php
mail/transport/abstract.php

index 6ac14c23146c6291a19fbcedc4c1645ff5fbb58e..2e055642f69faeb8fba232f4be5b8c79d44f3cec 100644 (file)
@@ -247,13 +247,13 @@ class IPF_Mail_Protocol_Imap
     public function escapeList($list)
     {
         $result = array();
-        foreach ($list as $k => $v) {
-            if (!is_array($v)) {
+        foreach ($list as $v) {
+            if (is_array($v)) {
+                $result[] = $this->escapeList($v);
+            } else {
 //              $result[] = $this->escapeString($v);
                 $result[] = $v;
-                continue;
             }
-            $result[] = $this->escapeList($v);
         }
         return '(' . implode(' ', $result) . ')';
     }
index 91dcfcb7945d9e58ca0159f265cbdefaf6442b36..ea98e1964974de6df01cbaa94895e5894fb520ae 100644 (file)
@@ -42,11 +42,6 @@ abstract class IPF_Mail_Transport_Abstract
         return $this->_headers;
     }
 
-    protected static function _formatHeader(&$item, $key, $prefix)
-    {
-        $item = $prefix . ': ' . $item;
-    }
-
     protected function _prepareHeaders($headers)
     {
         if (!$this->_mail) {
@@ -61,8 +56,9 @@ abstract class IPF_Mail_Transport_Abstract
                 $value = implode(',' . $this->EOL . ' ', $content);
                 $this->header .= $header . ': ' . $value . $this->EOL;
             } else {
-                array_walk($content, array(get_class($this), '_formatHeader'), $header);
-                $this->header .= implode($this->EOL, $content) . $this->EOL;
+                foreach ($content as $value) {
+                    $this->header .= $header . ': ' . $value . $this->EOL;
+                }
             }
         }