[wp-trac] [WordPress Trac] #50380: Check if _deprecated_file function exists in class-phpmailer.php

WordPress Trac noreply at wordpress.org
Fri Jun 12 19:54:55 UTC 2020


#50380: Check if _deprecated_file function exists in class-phpmailer.php
-------------------------------+-----------------------------
 Reporter:  TimothyBlynJacobs  |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Mail               |    Version:  trunk
 Severity:  normal             |   Keywords:  2nd-opinion
  Focuses:                     |
-------------------------------+-----------------------------
 The `class-phpmailer.php` library is loaded early in the tests bootstrap,
 before `wp-settings.php` is loaded. This means that the `_deprecated_file`
 function is not available at this point. Core's test bootstrap was updated
 at the same time to point to the new file location which means it hasn't
 run into this issue. However, any other bootstraps, like
 [https://github.com/wp-phpunit/wp-
 phpunit/blob/c941cdc355eccafb98364866c62da8d1e343cda0/includes/mock-
 mailer.php#L2 wp-phpunit] ( which is used by Gutenberg ) likely have not
 been updated.

 This causes errors like:

 {{{
 Fatal error: Uncaught Error: Call to undefined function _deprecated_file()
 in /var/www/html/wp-includes/class-phpmailer.php:6
 }}}

 We could provide compatibility for those alternate test runners by first
 checking if the `_deprecated_file` function exists before calling it.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50380>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list