| @@ 664-698 (lines=35) @@ | ||
| 661 | * @see PHPMailer::$SMTPDebug |
|
| 662 | * @param string $str |
|
| 663 | */ |
|
| 664 | protected function edebug($str) |
|
| 665 | {
|
|
| 666 | if ($this->SMTPDebug <= 0) {
|
|
| 667 | return; |
|
| 668 | } |
|
| 669 | //Avoid clash with built-in function names |
|
| 670 | if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
|
|
| 671 | call_user_func($this->Debugoutput, $str, $this->SMTPDebug); |
|
| 672 | return; |
|
| 673 | } |
|
| 674 | switch ($this->Debugoutput) {
|
|
| 675 | case 'error_log': |
|
| 676 | //Don't output, just log |
|
| 677 | error_log($str); |
|
| 678 | break; |
|
| 679 | case 'html': |
|
| 680 | //Cleans up output a bit for a better looking, HTML-safe output |
|
| 681 | echo htmlentities( |
|
| 682 | preg_replace('/[\r\n]+/', '', $str),
|
|
| 683 | ENT_QUOTES, |
|
| 684 | 'UTF-8' |
|
| 685 | ) |
|
| 686 | . "<br>\n"; |
|
| 687 | break; |
|
| 688 | case 'echo': |
|
| 689 | default: |
|
| 690 | //Normalize line breaks |
|
| 691 | $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
|
|
| 692 | echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
|
|
| 693 | "\n", |
|
| 694 | "\n \t ", |
|
| 695 | trim($str) |
|
| 696 | ) . "\n"; |
|
| 697 | } |
|
| 698 | } |
|
| 699 | ||
| 700 | /** |
|
| 701 | * Sets message type to HTML or plain. |
|
| @@ 202-236 (lines=35) @@ | ||
| 199 | * @param integer $level The debug level of this message; see DEBUG_* constants |
|
| 200 | * @return void |
|
| 201 | */ |
|
| 202 | protected function edebug($str, $level = 0) |
|
| 203 | {
|
|
| 204 | if ($level > $this->do_debug) {
|
|
| 205 | return; |
|
| 206 | } |
|
| 207 | //Avoid clash with built-in function names |
|
| 208 | if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
|
|
| 209 | call_user_func($this->Debugoutput, $str, $this->do_debug); |
|
| 210 | return; |
|
| 211 | } |
|
| 212 | switch ($this->Debugoutput) {
|
|
| 213 | case 'error_log': |
|
| 214 | //Don't output, just log |
|
| 215 | error_log($str); |
|
| 216 | break; |
|
| 217 | case 'html': |
|
| 218 | //Cleans up output a bit for a better looking, HTML-safe output |
|
| 219 | echo htmlentities( |
|
| 220 | preg_replace('/[\r\n]+/', '', $str),
|
|
| 221 | ENT_QUOTES, |
|
| 222 | 'UTF-8' |
|
| 223 | ) |
|
| 224 | . "<br>\n"; |
|
| 225 | break; |
|
| 226 | case 'echo': |
|
| 227 | default: |
|
| 228 | //Normalize line breaks |
|
| 229 | $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
|
|
| 230 | echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
|
|
| 231 | "\n", |
|
| 232 | "\n \t ", |
|
| 233 | trim($str) |
|
| 234 | )."\n"; |
|
| 235 | } |
|
| 236 | } |
|
| 237 | ||
| 238 | /** |
|
| 239 | * Connect to an SMTP server. |
|