[wp-trac] [WordPress Trac] #14710: PHPMailer class can cause an already declared error if including wp-config in an external script

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 27 04:36:11 UTC 2010


#14710: PHPMailer class can cause an already declared error if including wp-config
in an external script
-----------------------------+----------------------------------------------
 Reporter:  teamplaylotto    |       Owner:                  
     Type:  feature request  |      Status:  new             
 Priority:  normal           |   Milestone:  Awaiting Review 
Component:  Mail             |     Version:  3.0.1           
 Severity:  normal           |    Keywords:  phpmailer, class
-----------------------------+----------------------------------------------
 Can the next update please wrap PHPMailer class in a
 if(!class_exists('PHPMailer')){} block?

 If I am using an external script and include wp-config.php so I can use
 wordpress functions outside of Wordpress and the external script has
 already included the PHPMailer class, trying to use any wordpress code
 that results in an email being sent will cause a fatal error due to the
 class already being declared.

 This happens even if I wrap the external phpmailer class in the if not
 exists block because wordpress tries to declare the class after it has
 already been declared in the external script.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14710>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list