Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions extend/org/Crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions extend/org/transform/driver/Base64.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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)) {
Expand Down