Skip to content

Commit 334642e

Browse files
authored
Merge pull request dodgepudding#309 from hanpanpan1/master
fix media upload bug
2 parents 05d57ce + 84074b7 commit 334642e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

qywechat.class.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,9 @@ private function http_post($url,$param,$post_file=false){
273273
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 );
274274
curl_setopt($oCurl, CURLOPT_POST,true);
275275
curl_setopt($oCurl, CURLOPT_POSTFIELDS,$strPOST);
276+
if(PHP_VERSION_ID >= 50500){
277+
curl_setopt($oCurl, CURLOPT_SAFE_UPLOAD, FALSE);
278+
}
276279
$sContent = curl_exec($oCurl);
277280
$aStatus = curl_getinfo($oCurl);
278281
curl_close($oCurl);

wechat.class.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,9 @@ private function http_post($url,$param,$post_file=false){
11421142
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 );
11431143
curl_setopt($oCurl, CURLOPT_POST,true);
11441144
curl_setopt($oCurl, CURLOPT_POSTFIELDS,$strPOST);
1145+
if(PHP_VERSION_ID >= 50500){
1146+
curl_setopt($oCurl, CURLOPT_SAFE_UPLOAD, FALSE);
1147+
}
11451148
$sContent = curl_exec($oCurl);
11461149
$aStatus = curl_getinfo($oCurl);
11471150
curl_close($oCurl);

0 commit comments

Comments
 (0)