Fixed Error log/JSON error

Kent

Active member
Viewing an error log via AJAX causes a JSON error if the log contains certain unicode. Viewing the error directly by browsing works without error.
This error occurred from someone scanning my websites for vulnerabilities, not form normal usage.
\xC0\xAE and \xC0\xAF were used, which is a unicode dot and forward slash.

ErrorException: json_encode(): Invalid UTF-8 sequence in argument - library/XenForo/ViewRenderer/Json.php:179

An example error can be made via css.php:
/css.php?css=%C0%AE%C0%AF&dir[]=test

This particular unicode seems to cause errors with JSON anywhere it's used, though not always server errors.

Unicode such as Japanese doesn't cause an error:
/css.php?css=こんにちは&dir[]=test
/css.php?css=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF&dir[]=test
 
Top Bottom