Bug #7875 [Ana->Csd]: Impossible to extende Mail_mimeDecode

From: Date: Thu, 02 Sep 2010 13:07:57 +0000
Subject: Bug #7875 [Ana->Csd]: Impossible to extende Mail_mimeDecode
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-4744@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=7875&edit=1 ID: 7875 Updated by: alan@akbkhome.com Reported By: pavel dot hlousek at gmail dot com Summary: Impossible to extende Mail_mimeDecode -Status: Analyzed +Status: Closed Type: Bug Package: Mail_mimeDecode Package Version: CVS PHP Version: 4.4.1 -Assigned To: +Assigned To: alan_k Roadmap Versions: New Comment: -Status: Analyzed +Status: Closed -Assigned To: +Assigned To: alan_k 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. Previous Comments: ------------------------------------------------------------------------ [2006-06-12 11:21:23] pavel dot hlousek at gmail dot com Description: ------------ The line (178) in function decode(): $isStatic = !(isset($this) && get_class($this) == __CLASS__); disables extending the Mail_mimeDecode class. I suggest to replace it with more general: $isStatic = !(isset($this) && is_a($this, __CLASS__)); that works perfectly. Test script: --------------- class My_mimeDecode extends Mail_mimeDecode { var $_output_encoding_headers = false; function My_mimeDecode($input) { parent::Mail_mimeDecode($input); } function decode($params = null) { $this->_output_encoding_headers = isset($params['output_encoding_headers']) ? $params['output_encoding_headers'] : false; return parent::decode($params); } } $decoder =& new My_mimeDecode($my_email_message); $email = $decoder->decode(); Expected result: ---------------- A decoded email message in $email. Actual result: -------------- Raises error (line 189): Called statically and no input given ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=7875&edit=1

« previous php.pear.bugs (#4744) next »