Prechádzať zdrojové kódy

修正json_encode 转义序列bug

lewisay 9 rokov pred
rodič
commit
2de98a6c4b
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  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;
 	        }