浏览代码

修正json_encode 转义序列bug

lewisay 9 年之前
父节点
当前提交
2de98a6c4b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      qywechat.class.php

+ 1 - 1
qywechat.class.php

@@ -202,7 +202,7 @@ class Wechat
 	            elseif ($value === true)
 	            $str .= 'true';
 	            else
-	                $str .= '"' . addslashes ( $value ) . '"'; //All other things
+	                $str .= '"' .addcslashes($value, "\\\"\n\r\t/"). '"'; //All other things
 	            // :TODO: Is there any more datatype we should be in the lookout for? (Object?)
 	            $parts [] = $str;
 	        }