Plugin Directory

Changeset 2015343


Ignore:
Timestamp:
01/19/2019 03:40:18 PM (7 years ago)
Author:
billvolz
Message:

Fixed: From field from showing "From" in header value.

Location:
socketlabs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • socketlabs/tags/1.0.10/README.txt

    r1957144 r2015343  
    33Tags: email, injection, smtp, mailer, wp_mail, mailing, deliverability
    44Requires at least: 3.0.1
    5 Tested up to: 4.9.4
     5Tested up to: 5.0.1
    66Requires PHP: 3.0.1
    77Stable tag: 1.0.10
  • socketlabs/trunk/README.txt

    r1996702 r2015343  
    33Tags: email, injection, smtp, mailer, wp_mail, mailing, deliverability
    44Requires at least: 3.0.1
    5 Tested up to: 5.0.1
     5Tested up to: 5.0
    66Requires PHP: 3.0.1
    7 Stable tag: 1.0.10
     7Stable tag: 1.0.11
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5050
    5151== Change log
     52= 1.0.11 =`
     53* Fixed: From field from showing "From" in header value.
    5254= 1.0.10 =
    5355* Fixed: Removed api status check from plugin startup.
  • socketlabs/trunk/includes/class-socketlabs-mailer.php

    r1946261 r2015343  
    135135                            // Mainly for legacy -- process a From: header if it's there
    136136                            case 'from':
    137            
    138                                 $bracket_pos = strpos( $content, '<' );
    139                                 if ( $bracket_pos !== false ) {
    140                                     // Text before the bracketed email is the "From" name.
    141                                     if ( $bracket_pos > 0 ) {
    142                                         $from_name = substr( $content, 0, $bracket_pos - 1 );
    143                                         $from_name = str_replace( '"', '', $from_name );
    144                                         $from_name = trim( $from_name );
    145                                     }
    146    
    147                                     $from_email = substr( $content, $bracket_pos + 1 );
    148                                     $from_email = str_replace( '>', '', $from_email );
    149 
    150                        
    151                                     $contact_match;
    152                                     preg_match(self::contact_regex, $header, $contact_match);
    153 
    154                                     if(isset($contact_match[2])){
    155                                         $this->apply_from(isset($contact_match[1]) ? $contact_match[1] : "", $contact_match[2]);
    156                                     }
    157                                     // Avoid setting an empty $from_email.
    158                                 } elseif ( '' !== trim( $content ) ) {
     137                                $contact_match;
     138                                preg_match(self::contact_regex, $content, $contact_match);
     139
     140                                if(isset($contact_match[2])){
     141                                    $this->apply_from(isset($contact_match[1]) ? $contact_match[1] : "", $contact_match[2]);
     142                                }
     143                                elseif ( '' !== trim( $content ) ) {
    159144                                    $this->apply_from("", trim( $content ));
    160145                                }
     
    172157                                    }
    173158   
    174                                     // Avoid setting an empty $content_type.
     159                                // Avoid setting an empty $content_type.
    175160                                } elseif ( '' !== trim( $content ) ) {
    176161                                    $this->api_message["Charset"] = apply_filters( 'wp_mail_charset', trim( $content ) );
  • socketlabs/trunk/socketlabs.php

    r1957144 r2015343  
    1717 * Plugin URI:        https://github.com/socketlabs/wordpress
    1818 * Description:       Send emails using your SocketLabs account.
    19  * Version:           1.0.10
     19 * Version:           1.0.11
    2020 * Author:            SocketLabs
    2121 * Author URI:        https://socketlabs.com/
Note: See TracChangeset for help on using the changeset viewer.