Browse Source

Merge pull request #140 from leeeboo/patch-4

修复加密模式下没有appid的订阅号无法被动回复的问题。
dodge 10 years ago
parent
commit
9b03b4bd6b
1 changed files with 6 additions and 3 deletions
  1. 6 3
      wechat.class.php

+ 6 - 3
wechat.class.php

@@ -176,6 +176,7 @@ class Wechat
             	    }
             	}
             	$this->postxml = $array[1];
+            	$this->appid = $array[2];//为了没有appid的订阅号。
             } else {
                 $this->postxml = $postStr;
             }
@@ -2129,9 +2130,11 @@ class Prpcrypt
             print $e;
             return array(ErrorCode::$IllegalBuffer, null);
         }
-        if ($from_appid != $appid)
-            return array(ErrorCode::$ValidateAppidError, null);
-        return array(0, $xml_content);
+        //if ($from_appid != $appid)
+            //return array(ErrorCode::$ValidateAppidError, null);
+        //注释上面两行是为了没有appid的订阅号
+        
+        return array(0, $xml_content, $from_appid); //增加appid,为了解决后面加密回复消息的时候没有appid的订阅号会无法回复
 
     }