[pLog-svn] r7268 - plugins/branches/lifetype-1.2/moblog/class/moblog

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Sun Jan 14 15:47:34 EST 2024


Author: jondaley
Date: 2024-01-14 15:47:34 -0500 (Sun, 14 Jan 2024)
New Revision: 7268

Modified:
   plugins/branches/lifetype-1.2/moblog/class/moblog/mimeDecode.class.php
Log:
combined text/plain and text/html since they are both doing the same thing anyway.  PHP5.5 upgrade, replaced preg_replace /e with preg_replace_callback

Modified: plugins/branches/lifetype-1.2/moblog/class/moblog/mimeDecode.class.php
===================================================================
--- plugins/branches/lifetype-1.2/moblog/class/moblog/mimeDecode.class.php	2024-01-14 19:16:01 UTC (rev 7267)
+++ plugins/branches/lifetype-1.2/moblog/class/moblog/mimeDecode.class.php	2024-01-14 20:47:34 UTC (rev 7268)
@@ -145,7 +145,7 @@
     function Mail_mimeDecode($input)
     {
         list($header, $body)   = $this->_splitBodyHeader($input);
-
+        
         $this->_input          = $input;
         $this->_header         = $header;
         $this->_body           = $body;
@@ -276,13 +276,10 @@
         if (isset($content_type)) {
             switch (strtolower($content_type['value'])) {
                 case 'text/plain':
-                    $encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
-                    $this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body) : null;
-                    break;
-
                 case 'text/html':
                     $encoding = isset($content_transfer_encoding) ? $content_transfer_encoding['value'] : '7bit';
-                    $this->_include_bodies ? $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body) : null;
+                    if($this->_include_bodies)
+                      $return->body = ($this->_decode_bodies ? $this->_decodeBody($body, $encoding) : $body);
                     break;
 
                 case 'multipart/parallel':
@@ -596,7 +593,9 @@
         $input = preg_replace("/=\r?\n/", '', $input);
 
         // Replace encoded characters
-		$input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input);
+        $input = preg_replace_callback('/=([a-f0-9]{2})/i',
+                                       function($m){ return chr(hexdec($m[1])); },
+                                       $input);
 
         return $input;
     }



More information about the pLog-svn mailing list