Quellcode durchsuchen

增加空字符串就不解码逻辑

Zhu Jinhui vor 7 Jahren
Ursprung
Commit
474f20b092
1 geänderte Dateien mit 6 neuen und 2 gelöschten Zeilen
  1. 6 2
      src/Library/Crypt.php

+ 6 - 2
src/Library/Crypt.php

@@ -145,8 +145,12 @@ class Crypt
 	public function decrypt($string)
 	{
 		$string = str_replace(' ', '+', $string);
-		$string = base64_decode($this->verifyString($string));
-
+		$string = $this->verifyString($string);
+		if(!$string)
+        {
+            return '';
+        }
+		$string = base64_decode($string);
 		$passCrypt = openssl_decrypt($string, 'aes-256-cbc', $this->securityKey, OPENSSL_RAW_DATA, $this->getIv());
 		return substr($passCrypt, 10);
 	}