Commit b45f27ad by kaka Committed by lanrion

fixed nickname里面存在ascii控制字符 替换0x11~0x1F区间的ASCII

parent 7ea61e50
...@@ -50,7 +50,7 @@ module WeixinAuthorize ...@@ -50,7 +50,7 @@ module WeixinAuthorize
# return hash # return hash
def load_json(string) def load_json(string)
result_hash = JSON.parse(string) result_hash = JSON.parse(string.force_encoding("UTF-8").gsub(/[\u0011-\u001F]/, ""))
code = result_hash.delete("errcode") code = result_hash.delete("errcode")
en_msg = result_hash.delete("errmsg") en_msg = result_hash.delete("errmsg")
ResultHandler.new(code, en_msg, result_hash) ResultHandler.new(code, en_msg, result_hash)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment