Plugin Directory

Changeset 1725268


Ignore:
Timestamp:
09/05/2017 11:37:13 PM (9 years ago)
Author:
Cimmo
Message:

Fixed PHP Parse error regression on older PHP 5.x (despite they are now unsupported, thanks to Andrew Bruce)

Location:
cimy-swift-smtp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cimy-swift-smtp/trunk/README_OFFICIAL.txt

    r1723464 r1725268  
    6262
    6363CHANGELOG:
     64v3.0.1 - 06/09/2017
     65- Fixed PHP Parse error regression on older PHP 5.x (despite they are now unsupported, thanks to Andrew Bruce)
     66
    6467v3.0.0 - 02/09/2017
    6568- Updated Swift Mailer to 6.0.1 (dropped support for PHP <=5.x and WordPress <= 3.x)
  • cimy-swift-smtp/trunk/readme.txt

    r1723464 r1725268  
    66Requires at least: 4.0
    77Tested up to: 4.8
    8 Stable tag: 3.0.0
     8Stable tag: 3.0.1
    99
    1010Send email via SMTP (Compatible with GMAIL)
  • cimy-swift-smtp/trunk/swift_engine.php

    r1723422 r1725268  
    170170    }
    171171
    172     //Create a message
    173     $message = (new Swift_Message($subject))
     172    // Create a message
     173    $swift_message = (new Swift_Message($subject))
    174174        ->setFrom(array(apply_filters('wp_mail_from', $from_email) => apply_filters('wp_mail_from_name', $from_name)))
    175175        ->setBody($message)
     
    178178    // Set the sender, which may be different than the from field
    179179    if (!empty($sender_email)) {
    180         $message->setSender(array($sender_email => $sender_name));
     180        $swift_message->setSender(array($sender_email => $sender_name));
    181181    }
    182182
    183183    // Set the reply-to
    184184    if (!empty($reply_to)) {
    185         $message->setReplyTo($reply_to);
     185        $swift_message->setReplyTo($reply_to);
    186186    }
    187187
     
    201201        // leave the name null if empty
    202202        if (empty($recipient_name)) {
    203             $message->addTo(trim($recipient));
     203            $swift_message->addTo(trim($recipient));
    204204        }
    205205        else {
    206             $message->addTo(trim($recipient), $recipient_name);
     206            $swift_message->addTo(trim($recipient), $recipient_name);
    207207        }
    208208       
     
    222222            // leave the name null if empty
    223223            if (empty($recipient_name)) {
    224                 $message->addCc(trim($recipient));
     224                $swift_message->addCc(trim($recipient));
    225225            }
    226226            else {
    227                 $message->addCc(trim($recipient), $recipient_name);
     227                $swift_message->addCc(trim($recipient), $recipient_name);
    228228            }
    229229        }
     
    242242            // leave the name null if empty
    243243            if (empty($recipient_name)) {
    244                 $message->addBcc(trim($recipient));
     244                $swift_message->addBcc(trim($recipient));
    245245            }
    246246            else {
    247                 $message->addBcc(trim($recipient), $recipient_name);
     247                $swift_message->addBcc(trim($recipient), $recipient_name);
    248248            }
    249249        }
     
    257257    $content_type = apply_filters('wp_mail_content_type', $content_type);
    258258
    259     $message->setContentType($content_type);
     259    $swift_message->setContentType($content_type);
    260260
    261261    // If we don't have a charset from the input headers
     
    268268    // Set custom headers
    269269    if ( !empty( $headers ) ) {
    270         $msg_headers = $message->getHeaders();
     270        $msg_headers = $swift_message->getHeaders();
    271271
    272272        foreach((array) $headers as $name => $content) {
     
    286286                continue;
    287287            try {
    288                 $message->attach(Swift_Attachment::fromPath($attachment));
     288                $swift_message->attach(Swift_Attachment::fromPath($attachment));
    289289            } catch (Swift_IoException $e) {
    290290                continue;
     
    319319
    320320        // Send!
    321         $result = $mailer->send($message, $failures);
     321        $result = $mailer->send($swift_message, $failures);
    322322    }
    323323    catch (Exception $e) {
Note: See TracChangeset for help on using the changeset viewer.