From c7289e28b3ccd2efea141888f13665b75c5532f8 Mon Sep 17 00:00:00 2001 From: lin <465382251@qq.com> Date: Tue, 4 Jun 2019 10:49:24 +0800 Subject: [PATCH] update empty --- src/Request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Request.php b/src/Request.php index a3e8374..9e970f5 100644 --- a/src/Request.php +++ b/src/Request.php @@ -79,8 +79,8 @@ protected function signature(){ $param=$this->sort($param); $host_tmp=explode('https://', $this->host); - $temp=$this->type . "\n" . $host_tmp[1] . "\n" . $this->path . "\n" . implode('&', $param); - $signature=base64_encode(hash_hmac('sha256', $temp, $this->secret, true)); + if(isset($host_tmp[1])) $temp=$this->type . "\n" . $host_tmp[1] . "\n" . $this->path . "\n" . implode('&', $param); + $signature=base64_encode(hash_hmac('sha256', $temp ?? '', $this->secret, true)); $param[]="Signature=" . urlencode($signature);