FIX for "mb_detect_encoding() expects parameter 1 to be string, resource given"

When one of the debug arrays contains a resource, is_resource() function sometimes does not detect it well.
See http://php.net/manual/en/function.is-resource.php#103942 for details.
This is the fix for the situation.