private static function sanitize_errors($source) { if (is_array($source)) { if ($source && array_key_exists('errors', $source)) { foreach ($source['errors'] as &$error) { if (is_array($error)) { $error = self::sanitize_errors($error); } else { $error = ICL_AdminNotifier::sanitize_and_format_message($error); } } unset($error); } } else { $source = ICL_AdminNotifier::sanitize_and_format_message($source); } return $source; }