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
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
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
* `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
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
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
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