PHP Classes

Debug OFF doesn't override TLS debugging

Recommend this page to a friend!

      SMTP E-mail sending class  >  All threads  >  Debug OFF doesn't override TLS debugging  >  (Un) Subscribe thread alerts  
Subject:Debug OFF doesn't override TLS debugging
Summary:TLS debugging works even if debug variable is 0
Messages:1
Author:Klemen
Date:2012-11-01 13:10:12
 

  1. Debug OFF doesn't override TLS debugging   Reply   Report abuse  
Picture of Klemen Klemen - 2012-11-01 13:10:12
Hello,

First of all great class, have been using it for years now!

I think I came across a small error in the code so I thought I would share it.

** Description **

If you set Debug mode to off the class will still output "Starting TLS cryptograpic protocol" and "TLS started" debug messages when establishing a TLS connection.


** Code **

Line 1254:
$this->OutputDebug('Starting TLS cryptograpic protocol');

Line 1259:
$this->OutputDebug('TLS started');


** How to fix **

Add this code before the above two lines:

if($this->debug)


** Alternative fix **

To avoid repeating if($this->debug) throughout the script perhaps it would be better to remove all those lines and just change function OutputDebug to this:

Hello,

First of all great class, have been using it for years now!

I think I came across a small error in the code so I thought I would share it.

** Description **

If you set Debug mode to off the class will still output "Starting TLS cryptograpic protocol" and "TLS started" debug messages when establishing a TLS connection.


** Code **

Line 1254:
$this->OutputDebug('Starting TLS cryptograpic protocol');

Line 1259:
$this->OutputDebug('TLS started');


** How to fix **

Add this code before the above two lines:

if($this->debug)


** Alternative fix **

To avoid repeating if($this->debug) throughout the script perhaps it would be better to remove all those lines and just change function OutputDebug to this:

Function OutputDebug($message)
{
if($this->debug)
{
$message.="\n";
if($this->html_debug)
$message=str_replace("\n","<br />\n",HtmlEntities($message));
echo $message;
flush();
}
}


Thanks for all the valuable classes!

Sincerely,
Klemen