Pluf Framework

Issue 701: Pluf_Log_File cannot cope with non-utf8 data

Reported by Thomas Keller, Jun 15, 2011

The error is:

json_encode(): Invalid UTF-8 sequence in argument
pluf-master/src/Pluf/Log/File.php, line 54

The byte sequence that lead to this error was (output of od -c):

0000100    < 300 344 354 350 355 350 361 362 360 340 362 356 360  
 @   .
0000120    (   n   o   n   e   )   >  \n   D   a   t   e   :      
      

I think something along the line of this is needed:

http://trac.roundcube.net/browser/trunk/roundcubemail/program/include
/rcube_shared.inc#L536

Comment 1 by Mateus Caruccio, Aug 3, 2012

Hi, same problem here.

In my case, an invalid utf-8 log message cause an exception when 
json_encode() is call.

Attached is a patch to convert everything to utf-8 prior passing it 
to json_encode().

Work for me ;) Hope someone review it and apply to Pluf.

Regards,
Mateus Caruccio

Comment 2 by Mateus Caruccio, Aug 3, 2012

BTW, log messages should never ever ever crash the entire system. 
Better not log at all, but keep the system online.

Created: 1 year 11 months ago by Thomas Keller

Updated: 9 months 19 days ago

Status: New

Followed by: 1 person

Labels:
Priority:Medium
Type:Defect