Browse Source

修复bug: Prpcrypt类 兼容构造函数 位置顺序问题导致报错

binsee 10 years ago
parent
commit
2cc0d3796c
2 changed files with 10 additions and 10 deletions
  1. 5 5
      qywechat.class.php
  2. 5 5
      wechat.class.php

+ 5 - 5
qywechat.class.php

@@ -2087,18 +2087,18 @@ class Prpcrypt
 {
     public $key;
 
+    function __construct($k) {
+        $this->key = base64_decode($k . "=");
+    }
+
     /**
-     * 兼容老版本php构造函数
+     * 兼容老版本php构造函数,不能在 __construct() 方法前边,否则报错
      */
     function Prpcrypt($k)
     {
         $this->key = base64_decode($k . "=");
     }
 
-    function __construct($k) {
-        $this->key = base64_decode($k . "=");
-    }
-
     /**
      * 对明文进行加密
      * @param string $text 需要加密的明文

+ 5 - 5
wechat.class.php

@@ -3210,18 +3210,18 @@ class Prpcrypt
 {
     public $key;
 
+    function __construct($k) {
+        $this->key = base64_decode($k . "=");
+    }
+
     /**
-     * 兼容老版本php构造函数
+     * 兼容老版本php构造函数,不能在 __construct() 方法前边,否则报错
      */
     function Prpcrypt($k)
     {
         $this->key = base64_decode($k . "=");
     }
 
-    function __construct($k) {
-        $this->key = base64_decode($k . "=");
-    }
-
     /**
      * 对明文进行加密
      * @param string $text 需要加密的明文