Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.0

Bug #17866 Non-static method Mail_RFC822::parseAddressList called statically
Submitted: 2010-09-14 12:40 UTC Modified: 2011-01-14 20:09 UTC
From: myguitar82 Assigned: alec
Status: Closed Package: Mail (version 1.2.0)
PHP Version: 5.3.2 OS: Linux
Roadmaps: 1.2.1    
Subscription  


 [2010-09-14 12:40 UTC] myguitar82 (Brandon Liles)
Description: ------------ When running with E_STRICT: The non-static member function Mail_RFC822::parseAddressList is being called statically as shown below. $addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false); This object needs to be instantiated in order to use this member function as shown below. This avoids unnecessary PHP warnings. $Mail_RFC822 = new Mail_RFC822(); $addresses = $Mail_RFC822->parseAddressList($recipients, 'localhost', false); Test script: --------------- <?php require_once 'Mail.php'; require_once 'PEAR.php'; define('SMTP_SERVER', 'smtp.somewhere.net'); define('SMTP_PORT', 25); define('USERNAME', 'someone'); define('PASSWORD', '1LamePassword'); $objMail = new Mail; $objSMTP = $objMail->factory('smtp', array ( 'host' => SMTP_SERVER, 'port' => SMTP_PORT, 'auth' => true, 'username' => USERNAME, 'password' => PASSWORD)); $strFromEmail = "someone@somewhere.net"; $strFromName = "Some One"; $strToAddress = "SoAndSo@somewhere.net"; $aHeaders['From'] = "{$strFromName} <{$strFromEmail}>"; $aHeaders['To'] = $strToAddress; $aHeaders['Subject'] = "Test Message"; $objMail = $objSMTP->send($strToAddress, $aHeaders, "Hello world."); if(PEAR::isError($objMail)) { print "Error sending user message: " . $objMail->getMessage(); return false; } else return true; ?> Expected result: ---------------- ERROR: #2048 - Non-static method Mail_RFC822::parseAddressList() should not be called statically, assuming $this from incompatible context occurred in Mail.php on line 253

Comments

 [2010-09-14 12:43 UTC] myguitar82 (Brandon Liles)
 [2011-01-14 20:09 UTC] alec (Aleksander Machniak)
-Status: Open +Status: Closed -Assigned To: +Assigned To: alec -Roadmap Versions: +Roadmap Versions: 1.2.1
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.