diff --git a/extend/org/Crypt.php b/extend/org/Crypt.php index 0832cd6..a9ab5a4 100644 --- a/extend/org/Crypt.php +++ b/extend/org/Crypt.php @@ -125,9 +125,12 @@ public static function decrypt($value, $key, $target = 'url') $expire = substr($value, self::HMAC_SIZE, self::EXPIRE_SIZE); $iv = substr($value, self::HMAC_SIZE + self::EXPIRE_SIZE, self::IV_SIZE); $value = substr($value, self::HMAC_SIZE + self::EXPIRE_SIZE + self::IV_SIZE); + $expire = hexdec(bin2hex($expire)); // 超出有效期 - if (time() > hexdec(bin2hex($expire))) { - return false; + if($expire!==0){ + if (time() > hexdec(bin2hex($expire))) { + return false; + } } // 验证密文是否被篡改 if (static::compareString(static::hmac($iv, $value, $key), bin2hex($hmac)) === false) { diff --git a/extend/org/transform/driver/Base64.php b/extend/org/transform/driver/Base64.php index 85c67d7..b9a504d 100644 --- a/extend/org/transform/driver/Base64.php +++ b/extend/org/transform/driver/Base64.php @@ -32,7 +32,7 @@ class Base64 * @param string $data 欲编码的数据 * @param string $target 编码目标 */ - public function encode($data, $target = '') + public static function encode($data, $target = '') { // 当函数没有特别指定编码目标时, 使用类自身编码目标 if (empty($target)) { @@ -62,7 +62,7 @@ public function encode($data, $target = '') * @param string $data 欲解码的数据 * @param string $target 解码目标 */ - public function decode($data, $target = '') + public static function decode($data, $target = '') { // 当函数没有特别指定解码目标时, 使用类自身解码目标 if (empty($target)) {