浏览代码

Merge pull request #284 from lewisay/master

修正json_encode转义序列bug
dodge 9 年之前
父节点
当前提交
d3b296934f
共有 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;
 	        }