WordPress.org

Make WordPress Core

Ticket #25253: pluggable.diff

File pluggable.diff, 502 bytes (added by pixelbath, 4 years ago)

Patch to check whether the PHPMailer class exists prior to require_once

  • C:/_code/

    old new  
    209209        global $phpmailer;
    210210
    211211        // (Re)create it, if it's gone missing
    212         if ( ! ( $phpmailer instanceof PHPMailer ) ) {
     212        if (!class_exists('PHPMailer')) {
    213213                require_once ABSPATH . WPINC . '/class-phpmailer.php';
    214214                require_once ABSPATH . WPINC . '/class-smtp.php';
     215        }
     216        if (!($phpmailer instanceof PHPMailer )) {
    215217                $phpmailer = new PHPMailer( true );
    216218        }
    217219