Commit Graph

39 Commits

Author SHA1 Message Date
Sergey Biryukov aa5017ebb9 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.
Built from https://develop.svn.wordpress.org/trunk@48035


git-svn-id: http://core.svn.wordpress.org/trunk@47802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-12 21:42:09 +00:00
TimothyBlynJacobs afaeaf1529 External Libraries: Skip deprecated file warning for PHPMailer if the API is not loaded.
In [48033] the "class-phpmailer.php" file was deprecated. In test suites, this file is loaded before WordPress in order to setup a mock PHPMailer instance. This means that for test suites that are still loading that file, they'll experience fatal errors due to the undefined "_deprecated_file" function.

This commit skips issuing the deprecated file warning if the "_deprecated_file" function is not available.

Fixes #50380.

Built from https://develop.svn.wordpress.org/trunk@48034


git-svn-id: http://core.svn.wordpress.org/trunk@47801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-12 21:10:08 +00:00
desrosj e4379c5ba8 External Libraries: Upgrade PHPMailer to version 6.1.6.
Now that WordPress Core supports PHP >= 5.6, the PHPMailer library can be updated to the latest version.

The PHPMailer files now reside in a new directory, `wp-includes/PHPMailer`. These files are copied verbatim from the library upstream and will make updating in the future easier. For backwards compatibility, the old files will remain and trigger deprecated file warnings.

The PHPMailer class is also now under the `PHPMailer\PHPMailer\PHPMailer` namespace. The `PHPMailer` class in the global namespace has been aliased for a seamless transition.

This upgrade also clears up a handful of PHP compatibility issues detailed in #49922.

For a full list of changes, see the PHPMailer GitHub: https://github.com/PHPMailer/PHPMailer/compare/v5.2.27...v6.1.6.

Props Synchro, SergeyBiryukov, desrosj, donmhico, ayeshrajans.
Fixes #41750.
Built from https://develop.svn.wordpress.org/trunk@48033


git-svn-id: http://core.svn.wordpress.org/trunk@47800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-12 15:47:07 +00:00
Sergey Biryukov 47ed56f38f Code Modernization: Replace `dirname( __FILE__ )` calls with `__DIR__` magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.

This commit also includes:

* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
 * `wp-admin/admin-header.php`
 * `wp-admin/admin-footer.php`
 * `wp-includes/version.php`

Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes #48082.
Built from https://develop.svn.wordpress.org/trunk@47198


git-svn-id: http://core.svn.wordpress.org/trunk@46998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 06:33:11 +00:00
desrosj b763447019 General: Patch PHMailer for PHP 7.4 compatibility.
This patches the PHPMailer library in Core to be PHP 7.4 compatible by adding a version check before calling `get_magic_quotes_runtime()`.

Props ayeshrajans, jrf.
See #47783.
Built from https://develop.svn.wordpress.org/trunk@46378


git-svn-id: http://core.svn.wordpress.org/trunk@46177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-03 15:45:59 +00:00
Sergey Biryukov b987372d75 Mail: Update PHPMailer to 5.2.27.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.22...PHPMailer:v5.2.27

Props MattyRob, ayeshrajans, rogueresearch, bgermann, slaFFik, Presskopp, aaroncampbell.
Fixes #40472.
Built from https://develop.svn.wordpress.org/trunk@46097


git-svn-id: http://core.svn.wordpress.org/trunk@45909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-12 14:37:57 +00:00
Dion Hulse 5eb452d15b Update PHPMailer to 5.2.22.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.21...v5.2.22

Fixes #37210 for trunk.

Built from https://develop.svn.wordpress.org/trunk@39759


git-svn-id: http://core.svn.wordpress.org/trunk@39697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 01:23:41 +00:00
Dion Hulse 24767c76d3 Upgrade PHPMailer from 5.2.14 to 5.2.21.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.14...v5.2.21

Props sebastian.pisula, MattyRob, sfpt, dd32.
Fixes #37210 for trunk.

Built from https://develop.svn.wordpress.org/trunk@39645


git-svn-id: http://core.svn.wordpress.org/trunk@39585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-29 02:53:44 +00:00
Scott Taylor a3ffebce30 Bootstrap: do not go gentle into that good night r38411, r38412, and parts of r38389.
See #36335.

Built from https://develop.svn.wordpress.org/trunk@38470


git-svn-id: http://core.svn.wordpress.org/trunk@38411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 16:31:29 +00:00
Scott Taylor 390ceba6c7 Bootstrap: after r38409 and r38410, revert r38402 which reverted r38399.
This fixes the paths in `wp-vendor/` that were including `src`. I want to drop this in so we can find out what else will break.

See #36335.

Built from https://develop.svn.wordpress.org/trunk@38411


git-svn-id: http://core.svn.wordpress.org/trunk@38352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 22:32:37 +00:00
Dion Hulse 0e31a46161 Bootstrap: Revert [38399] as it's broken `/build/` and subsequently core.svn.wordpress.org.
The generated classmaps reference `/src/` files and operates in the assumption that the base directory is one level above `wp-settings.php`, which it isn't after our build processes are run.

See #36335

Built from https://develop.svn.wordpress.org/trunk@38402


git-svn-id: http://core.svn.wordpress.org/trunk@38343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 14:37:32 +00:00
Scott Taylor 6a529648cf Bootstrap: Autoload classes using a Composer-generated PHP 5.2-compatible Autoloader.
* `wp-admin` and `wp-includes` are scanned for classes to autoload
* Several 3rd-party and Ryan McCue-shaped libraries are excluded when the classmap is generated, see `composer.json`: `autoload.exclude-from-classmap`
* `wp-vendor/autoload_52.php` is included at the top of `wp-settings.php` - no changes need to be made to unit tests to include the autoloader
* An avalanche of `require()` and `require_once()` calls that loaded class files have been removed from the codebase.

The following files have been added to `svn:ignore` - they are not 5.2-compatible and fail during pre-commit:
* src/wp-vendor/autoload.php
* src/wp-vendor/composer/autoload_real.php
* src/wp-vendor/composer/autoload_static.php
* src/wp-vendor/composer/ClassLoader.php

We favor these files instead:
* src/wp-vendor/autoload_52.php
* src/wp-vendor/composer/autoload_real_52.php
* src/wp-vendor/composer/ClassLoader52.php

When new PHP classes are added to the codebase, simply run `composer install` or `composer update` from the project root to update the autoloader.

The future is now.

See #36335.

Built from https://develop.svn.wordpress.org/trunk@38399


git-svn-id: http://core.svn.wordpress.org/trunk@38340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 09:15:29 +00:00
Gary Pendergast bd1d11b3cf Upgrade PHPMailer from 5.2.10 to 5.2.14.
The full list of changes is available here: https://github.com/PHPMailer/PHPMailer/compare/v5.2.10...v5.2.14

Fixes #35212 for trunk.


Built from https://develop.svn.wordpress.org/trunk@36083


git-svn-id: http://core.svn.wordpress.org/trunk@36048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-24 01:59:26 +00:00
Dominik Schilling 6963767a7c Remove debug cruft from [33124].
see #28909.
Built from https://develop.svn.wordpress.org/trunk@33142


git-svn-id: http://core.svn.wordpress.org/trunk@33113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-09 07:56:24 +00:00
Dominik Schilling efda1aeb3a Update PHPMailer to 5.2.10 from 5.2.7.
Includes two modifications for WordPress:
* Removes support for NTLM in `class-smtp.php` since the required client (`extras/ntlm_sasl_client.php`) is not distributed as part of WordPress.
* Requires `class-smtp.php` for backwards compatibility with direct (non-wp_mail()) uses of PHPMailer, as the autoloader isn't used. See [27385].

This also includes a change to our `MockMailer` for unit tests. It now overrides `postSend() instead of `send()`, and `preSend()`.
`preSend()` resets `$this->Encoding` because PHPMailer doesn't clean up after itself / presets all variables. This becomes an issue when `PHPMailer::createBody()` sets `$this->Encoding = 'quoted-printable'` (away from it's default of 8bit) when it encounters a line longer than 998 characters. `Tests_Comment::test_comment_field_lengths` is such a case.

props MattyRob, dd32.
fixes #28909.
Built from https://develop.svn.wordpress.org/trunk@33124


git-svn-id: http://core.svn.wordpress.org/trunk@33095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-08 17:16:25 +00:00
Andrew Nacin 8ab673281d Update PHPMailer to 5.2.7 from 5.2.4.
Includes two trivial modifications for WordPress:
 * Doesn't use the autoloader, so the check to enforce the autoloader from the constructor is removed.
 * Requires class-smtp.php for backwards compatibility with direct (non-wp_mail()) uses of PHPMailer, as the autoloader isn't used.

props bpetty.
fixes #25560.

Built from https://develop.svn.wordpress.org/trunk@27385


git-svn-id: http://core.svn.wordpress.org/trunk@27233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-03 20:25:14 +00:00
Andrew Nacin e46b819bb6 Backport a fix for qmail from PHPMailer upstream.
props bpetty.
fixes #25014.

Built from https://develop.svn.wordpress.org/trunk@25682


git-svn-id: http://core.svn.wordpress.org/trunk@25598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-03 03:00:09 +00:00
Andrew Nacin 46a8e6e3de Update to PHPMailer 5.2.4. props bpetty. fixes #21074.
git-svn-id: http://core.svn.wordpress.org/trunk@23522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-28 18:33:13 +00:00
nacin 08efb40e98 Do not pass mail() a fourth argument when safe_mode is in effect.
Fixes the sending of mail when in safe_mode. There is a bug report being addressed upstream with PHPMailer.

props sumindmitriy. see #20970 for trunk.



git-svn-id: http://core.svn.wordpress.org/trunk@21128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-06-26 03:54:17 +00:00
ryan 8c114f0c54 Pinking shears
git-svn-id: http://core.svn.wordpress.org/trunk@20715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-03 16:41:59 +00:00
ryan 572242350a Upgrade PHPMailer to 5.2.1. Props MattyRob. fixes #19887
git-svn-id: http://svn.automattic.com/wordpress/trunk@19849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-02-07 16:13:51 +00:00
ryan 98a96139df Include class-smtp.php not class.smtp.php. fixes #19677
git-svn-id: http://svn.automattic.com/wordpress/trunk@19642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-02 20:44:04 +00:00
westi 418b10e5ae Update PHPMailer to version 5.2. See #19677
git-svn-id: http://svn.automattic.com/wordpress/trunk@19632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-28 12:59:13 +00:00
westi 3af271ea94 Fix typo in PHPMailer. Fixes #17614 props pross.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-06-01 20:42:47 +00:00
ryan a1128831ec Update phpmailer and smtp to 5.1. Props MattyRob cnorris23. fixes #15912
git-svn-id: http://svn.automattic.com/wordpress/trunk@17676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-04-21 20:29:30 +00:00
ryan f47c8c729c Update PHPMailer to 2.0.4. Props hakre. fixes #9697
git-svn-id: http://svn.automattic.com/wordpress/trunk@11341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-05-15 17:32:35 +00:00
ryan bc57e47e02 Fix callbacks. Props Denis-de-Bernardy. fixes #9722 see #9697
git-svn-id: http://svn.automattic.com/wordpress/trunk@11195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-05-05 05:35:56 +00:00
ryan f52d1dd2b0 Eliminate preg_replace with /e. Props tbaboon. fixes #8689
git-svn-id: http://svn.automattic.com/wordpress/trunk@11098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-04-27 16:17:24 +00:00
ryan d5ca3badae Add missing preg delimiters. Props ridgerunner. fixes #8986 for trunk
git-svn-id: http://svn.automattic.com/wordpress/trunk@10459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2009-01-29 17:46:31 +00:00
westi 6651c7a69d phpdoc fixes for the phpmailer classes.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-09-03 21:42:50 +00:00
ryan d0ac3df8f7 Update phpMailer to 2.0.2. Props mattyrob. fixes #7474
git-svn-id: http://svn.automattic.com/wordpress/trunk@8762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-08-28 20:26:36 +00:00
westi f8a32e8d47 Updated phpdoc for external libs. See #7038 props jacobsantos.
git-svn-id: http://svn.automattic.com/wordpress/trunk@8082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-06-14 16:36:13 +00:00
ryan d0f6f37841 Change default phpmailer address
git-svn-id: http://svn.automattic.com/wordpress/trunk@7451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2008-03-21 16:11:47 +00:00
ryan 321c310717 Remove trailing whitespace
git-svn-id: http://svn.automattic.com/wordpress/trunk@6026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-09-03 23:32:58 +00:00
markjaquith 44df30f2d6 Fix class-smtp.php typo. Props Nazgul, tension7. fixes #4700
git-svn-id: http://svn.automattic.com/wordpress/trunk@5852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-08-05 18:13:24 +00:00
ryan 2f09416258 Trim empty lines. Nothing but newline.
git-svn-id: http://svn.automattic.com/wordpress/trunk@5700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-14 02:25:30 +00:00
ryan 66e6a55c7e escapeshellarg the sender
git-svn-id: http://svn.automattic.com/wordpress/trunk@5682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-06-11 23:19:33 +00:00
ryan b33a7e9cfb Set eol-style
git-svn-id: http://svn.automattic.com/wordpress/trunk@5390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-05-04 21:28:50 +00:00
ryan 7effafd4ee Trying out phpmailer for wp_mail(). fixes #3862
git-svn-id: http://svn.automattic.com/wordpress/trunk@4946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2007-02-25 20:23:25 +00:00