test on 'null', as json_last_error is a php5.3.x function

This commit is contained in:
Klaus Leithoff 2011-06-22 10:48:00 +00:00
parent 5c0383bac6
commit 5f175e23fd

View File

@ -1364,7 +1364,8 @@ pre {
{
$test = json_encode($singleBodyPart['body']);
//error_log(__METHOD__.__LINE__.'#'.$test.'# ->'.strlen($singleBodyPart['body']).' Error:'.json_last_error());
if (json_last_error() != JSON_ERROR_NONE && strlen($singleBodyPart['body'])>0)
//if (json_last_error() != JSON_ERROR_NONE && strlen($singleBodyPart['body'])>0)
if ($test=="null" && strlen($singleBodyPart['body'])>0)
{
// this should not be needed, unless something fails with charset detection/ wrong charset passed
error_log(__METHOD__.__LINE__.' Charset Reported:'.$singleBodyPart['charSet'].' Carset Detected:'.felamimail_bo::detect_encoding($singleBodyPart['body']));