Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Won't Fix
-
3.0.9
-
None
Description
Hello,
Considering this bit of the code :
|
// Ok we have error checked as much as we can to this point let's get on it already. |
ob_start();
|
$smtp->socket = fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20); |
$error_contents = ob_get_clean(); |
|
if (!$smtp->socket) |
{
|
if ($errstr) |
{
|
$errstr = utf8_convert_message($errstr); |
}
|
|
$err_msg = (isset($user->lang['NO_CONNECT_TO_SMTP_HOST'])) ? sprintf($user->lang['NO_CONNECT_TO_SMTP_HOST'], $errno, $errstr) : "Could not connect to smtp host : $errno : $errstr"; |
$err_msg .= ($error_contents) ? '<br /><br />' . htmlspecialchars($error_contents) : ''; |
return false; |
}
|
While $errstr is properly reconverted from ISO-8859-1 to UTF-8, $error_contents is not, and this later make the add_log query fail.
Solution is simple :
|
$err_msg .= ($error_contents) ? '<br /><br />' . utf8_convert_message($error_contents) : ''; |
It fixed the matter.
FWIW, I was trying to recover a password from a test board using a smtp server which would not accept connexion from where I was (this was a config mistake in the first place) and which did not "speack english".
The $error_contents actually contained the same data as $errstr with the few additions made by msg_handler thus triggered by fsockopen failure.
Hope this helps.
dcz