Bug #19659 [Opn->Dup]: Mail_mine::get() throws nonsense error

From: Date: Tue, 23 Oct 2012 08:32:07 +0000
Subject: Bug #19659 [Opn->Dup]: Mail_mine::get() throws nonsense error
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-9210@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19659&edit=1 ID: 19659 Updated by: alec@alec.pl Reported By: matteosistisette at gmail dot com Summary: Mail_mine::get() throws nonsense error -Status: Open +Status: Duplicate Type: Bug Package: Mail_Mime Operating System: linux Package Version: 1.8.5 PHP Version: 5.3.18 Roadmap Versions: New Comment: -Status: Open +Status: Duplicate This is a duplicate of #19473. Previous Comments: ------------------------------------------------------------------------ [2012-10-20 18:43:35] matteosistisette Description: ------------ I get the attached error when calling Mail_mine::get() Test script: --------------- Error trace contains sample code Expected result: ---------------- It is very possible that I'm doing something wrong, but even if I am, an uncaught php error generated INSIDE of the library code it is ALWAYS a bug. A meaningful exception with an informative error message explaining what's wrong with the input (_if_ there is something wrong) should be thrown, not this messy error. Actual result: -------------- PHP error Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context /opt/lampp/lib/php/Mail/mime.php(1031) 1019 // Write output to file 1020 if ($filename) { 1021 // Append mimePart message headers and body into file 1022 $headers = $message- >encodeToFile($filename, $boundary, $skip_head); 1023 if (PEAR::isError($headers)) { 1024 return $headers; 1025 } 1026 $this->_headers = array_merge($this- >_headers, $headers); 1027 $ret = null; 1028 return $ret; 1029 } else { 1030 $output = $message->encode($boundary, $skip_head); 1031 if (PEAR::isError($output)) { 1032 return $output; 1033 } 1034 $this->_headers = array_merge($this- >_headers, $output['headers']); 1035 $body = $output['body']; 1036 return $body; 1037 } 1038 } 1039 1040 /** 1041 * Returns an array with the headers needed to prepend to the email 1042 * (MIME-Version and Content-Type). Format of argument is: 1043 * $array['header-name'] = 'header-value'; Stack Trace #0 – /media/DATA/lavoro/megafone/httpdocs/protected/component s/MailComponent.php(29): Mail_mime->get() 24 $headersencoded[$header]=$mail- >encodeHeader($header, $value, "utf-8", "quoted-printable"); 25 } 26 $to=$mail->encodeHeader('To',$address,"utf-8", "quoted-printable"); 27 28 $mail->headers($headersencoded); 29 $msg=$mail->get(); 30 $factory=Mail::factory('mail'); 31 return $factory->send($to,$headersencoded,$msg); 32 33 } 34 #1 – /media/DATA/lavoro/megafone/httpdocs/protected/models/Us er.php(410): MailComponent- >sendMail("matteosistisette@gmail.com", " [MONTRÉAL*inaccessible] Account activation information for Matt...", "Dear MatteoOtroTestXXX, Wellcome to MONTRÉAL*inaccessible. ...") 405 '{USER}'=>$this->getActualDisplayName(), 406 '{ACT_URL}'=>$url, 407 '{TITLE}'=>$title, 408 )); 409 410 return Yii::app()->mail->sendMail($this->email, $subject, $body); 411 } 412 413 public function sendApprovalEmail() { 414 $title=I::tattr($this->currentArea->partialRoot, 'menu.home', $this->preferredLanguage); 415 $url=Yii::app()- >createAbsoluteUrl('message/index',array('in'=>$this- >currentArea->id,'author_id'=>$this->id)); ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19659&edit=1

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