Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please remove the escape character in the json url #65

Closed
ZevShiShi opened this issue Jan 18, 2021 · 0 comments
Closed

Please remove the escape character in the json url #65

ZevShiShi opened this issue Jan 18, 2021 · 0 comments
Assignees
Labels

Comments

@ZevShiShi
Copy link

ZevShiShi commented Jan 18, 2021

Please remove the escape character in the json url, it will affect the http url preview, it is caused by jsonObject or JsonArray, for example: http:\/\/xx.xxx.xxx\/image\/20210114\/5beaba40044e421f8dbad2b0e5726d42.jpg, \/Replace with/

Printer.class

        private fun getJsonString(msg: String): String {
            var message: String
            message = try {
                when {
                    msg.startsWith("{") -> {
                        val jsonObject = JSONObject(msg)
                        jsonObject.toString(JSON_INDENT)
                    }
                    msg.startsWith("[") -> {
                        val jsonArray = JSONArray(msg)
                        jsonArray.toString(JSON_INDENT)
                    }
                    else -> {
                        msg
                    }
                }
            } catch (e: JSONException) {
                msg
            } catch (e1: OutOfMemoryError) {
                OOM_OMITTED
            }
             // TODO: 2021/1/18 Add code here  
            if (message.indexOf("\\/") != -1) {
                message = message.replace("\\/", "/")
            }
            return message
        }
@ihsanbal ihsanbal added the bug label Jan 18, 2021
@ihsanbal ihsanbal self-assigned this Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants