Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Thursday, October 15, 2026

Diff for Metafox/lib/Mail/mimeDecode.php between version 1.4 and 1.5

version 1.4, 2006/03/29 09:23:13 version 1.5, 2024/11/20 15:48:04
Line 65  require_once 'PEAR.php';
Line 65  require_once 'PEAR.php';
 *  o Implement multipart/appledouble  *  o Implement multipart/appledouble
 *  o UTF8: ???  *  o UTF8: ???
   
                 > 4. We have also found a solution for decoding the UTF-8                  > 4. We have also found a solution for decoding the UTF-8
                 > headers. Therefore I made the following function:                  > headers. Therefore I made the following function:
                 >                  >
                 > function decode_utf8($txt) {                  > function decode_utf8($txt) {
                 > $trans=array("Å‘"=>"õ","ű"=>"û","Å�"=>"Õ","Ű"                  > $trans=array("�‘"=>"õ","ű"=>"û","Å�"=>"�•","Ű"
                 =>"Û");                  =>"�›");
                 > $txt=strtr($txt,$trans);                  > $txt=strtr($txt,$trans);
                 > return(utf8_decode($txt));                  > return(utf8_decode($txt));
                 > }                  > }
                 >                  >
                 > And I have inserted the following line to the class:                  > And I have inserted the following line to the class:
                 >                  >
                 > if (strtolower($charset)=="utf-8") $text=decode_utf8($text);                  > if (strtolower($charset)=="utf-8") $text=decode_utf8($text);
                 >                  >
                 > ... before the following one in the "_decodeHeader" function:                  > ... before the following one in the "_decodeHeader" function:
                 >                  >
                 > $input = str_replace($encoded, $text, $input);                  > $input = str_replace($encoded, $text, $input);
                 >                  >
                 > This way from now on it can easily decode the UTF-8 headers too.                  > This way from now on it can easily decode the UTF-8 headers too.
   
 *  *
Line 236  class Mail_mimeDecode extends PEAR
Line 236  class Mail_mimeDecode extends PEAR
         }          }
   
         reset($headers);          reset($headers);
         while (list($key, $value) = each($headers)) {                  foreach ($headers as $key => $value) {
             $headers[$key]['name'] = strtolower($headers[$key]['name']);              $headers[$key]['name'] = strtolower($headers[$key]['name']);
             switch ($headers[$key]['name']) {              switch ($headers[$key]['name']) {
   
Line 249  class Mail_mimeDecode extends PEAR
Line 249  class Mail_mimeDecode extends PEAR
                     }                      }
   
                     if (isset($content_type['other'])) {                      if (isset($content_type['other'])) {
                         while (list($p_name, $p_value) = each($content_type['other'])) {                                                  foreach ($content_type['other'] as $p_name => $p_value) {
                             $return->ctype_parameters[$p_name] = $p_value;                              $return->ctype_parameters[$p_name] = $p_value;
                         }                          }
                     }                      }
Line 259  class Mail_mimeDecode extends PEAR
Line 259  class Mail_mimeDecode extends PEAR
                     $content_disposition = $this->_parseHeaderValue($headers[$key]['value']);                      $content_disposition = $this->_parseHeaderValue($headers[$key]['value']);
                     $return->disposition   = $content_disposition['value'];                      $return->disposition   = $content_disposition['value'];
                     if (isset($content_disposition['other'])) {                      if (isset($content_disposition['other'])) {
                         while (list($p_name, $p_value) = each($content_disposition['other'])) {                                                  foreach ($content_disposition['other'] as $p_name => $p_value) {
                             $return->d_parameters[$p_name] = $p_value;                              $return->d_parameters[$p_name] = $p_value;
                         }                          }
                     }                      }
Line 350  class Mail_mimeDecode extends PEAR
Line 350  class Mail_mimeDecode extends PEAR
             }              }
             for ($i = 0; $i < count($structure->parts); $i++) {              for ($i = 0; $i < count($structure->parts); $i++) {
   
   
                 if (!empty($structure->headers['content-type']) AND substr(strtolower($structure->headers['content-type']), 0, 8) == 'message/') {                  if (!empty($structure->headers['content-type']) AND substr(strtolower($structure->headers['content-type']), 0, 8) == 'message/') {
                     $prepend      = $prepend . $mime_number . '.';                      $prepend      = $prepend . $mime_number . '.';
                     $_mime_number = '';                      $_mime_number = '';
Line 370  class Mail_mimeDecode extends PEAR
Line 370  class Mail_mimeDecode extends PEAR
             $structure->mime_id = $prepend . $mime_number;              $structure->mime_id = $prepend . $mime_number;
             $no_refs ? $return[$prepend . $mime_number] = '' : $return[$prepend . $mime_number] = &$structure;              $no_refs ? $return[$prepend . $mime_number] = '' : $return[$prepend . $mime_number] = &$structure;
         }          }
   
         return $return;          return $return;
     }      }
   
Line 674  class Mail_mimeDecode extends PEAR
Line 674  class Mail_mimeDecode extends PEAR
   
     /**      /**
      * getSendArray() returns the arguments required for Mail::send()       * getSendArray() returns the arguments required for Mail::send()
      * used to build the arguments for a mail::send() call       * used to build the arguments for a mail::send() call
      *       *
      * Usage:       * Usage:
      * $mailtext = Full email (for example generated by a template)       * $mailtext = Full email (for example generated by a template)
Line 716  class Mail_mimeDecode extends PEAR
Line 716  class Mail_mimeDecode extends PEAR
         }          }
         $to = substr($to,1);          $to = substr($to,1);
         return array($to,$header,$this->_body);          return array($to,$header,$this->_body);
     }      }
   
     /**      /**
      * Returns a xml copy of the output of       * Returns a xml copy of the output of

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top