WordPress.org

Make WordPress Core

Changeset 48035


Ignore:
Timestamp:
06/12/2020 09:40:52 PM (15 months ago)
Author:
SergeyBiryukov
Message:

External Libraries: Add class aliases for phpmailerException and SMTP to deprecated files to account for the new namespace.

This ensures backward compatibility with plugins using the old class-phpmailer.php or class-smtp.php files.

Follow-up to [48033].

Props Otto42.
Fixes #50379. See #41750.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-phpmailer.php

    r48034 r48035  
    55 */
    66if ( function_exists( '_deprecated_file' ) ) {
    7     _deprecated_file( basename( __FILE__ ), '5.5.0', WPINC . '/PHPMailer/PHPMailer.php', __( 'The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.' ) );
     7    _deprecated_file(
     8        basename( __FILE__ ),
     9        '5.5.0',
     10        WPINC . '/PHPMailer/PHPMailer.php',
     11        __( 'The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.' )
     12    );
    813}
     14
    915require __DIR__ . '/PHPMailer/PHPMailer.php';
     16require __DIR__ . '/PHPMailer/Exception.php';
    1017
    1118class_alias( PHPMailer\PHPMailer\PHPMailer::class, 'PHPMailer' );
     19class_alias( PHPMailer\PHPMailer\Exception::class, 'phpmailerException' );
  • trunk/src/wp-includes/class-smtp.php

    r48033 r48035  
    44 * The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.
    55 */
    6 _deprecated_file( basename( __FILE__ ), '5.5.0', WPINC . '/PHPMailer/SMTP.php', __( 'The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.' ) );
     6_deprecated_file(
     7    basename( __FILE__ ),
     8    '5.5.0',
     9    WPINC . '/PHPMailer/SMTP.php',
     10    __( 'The SMTP class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.' )
     11);
     12
    713require __DIR__ . '/PHPMailer/SMTP.php';
     14
     15class_alias( PHPMailer\PHPMailer\SMTP::class, 'SMTP' );
Note: See TracChangeset for help on using the changeset viewer.