Small fixes

This commit is contained in:
RainLoop Team 2014-05-15 20:06:44 +04:00
parent 67f666fa7d
commit 9b59ad32dc
16 changed files with 433 additions and 233 deletions

View file

@ -200,8 +200,22 @@ abstract class NetClient
$this->rConnect = @\fsockopen($this->sConnectedHost, $this->iConnectedPort,
$iErrorNo, $sErrorStr, $this->iConnectTimeOut);
if (!is_resource($this->rConnect))
if (!\is_resource($this->rConnect))
{
if (!empty($sErrorStr) && !\MailSo\Base\Utils::IsUtf8($sErrorStr))
{
$sCharset = \MailSo\Base\Utils::DetectSystemCharset();
if (!empty($sCharset))
{
$sErrorStr = \MailSo\Base\Utils::ConvertEncoding(
$sErrorStr, $sCharset, \MailSo\Base\Enumerations\Charset::UTF_8);
}
else
{
$sErrorStr = @\utf8_encode($sErrorStr);
}
}
$this->writeLogException(
new Exceptions\SocketCanNotConnectToHostException(
$sErrorStr, $iErrorNo,