From 3384f53fa957de890ea2fb8dedda8c16b5885aa3 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 21 Jul 2021 17:41:43 +0800 Subject: [PATCH] * fix bug. --- framework/base/helper.class.php | 4 ++-- framework/router.class.php | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index 33e13afff4..01abfd7f3e 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -284,7 +284,7 @@ class baseHelper $secret = $config->encryptSecret; if(function_exists('mcrypt_encrypt')) { - $encrypted = base64_encode(@mcrypt_encrypt(MCRYPT_DES, $secret, $password, MCRYPT_MODE_CBC)); + $encrypted = base64_encode(@mcrypt_encrypt(MCRYPT_DES, substr($secret, 0, 8), $password, MCRYPT_MODE_CBC)); } elseif(function_exists('openssl_encrypt')) { @@ -322,7 +322,7 @@ class baseHelper } elseif(function_exists('openssl_decrypt')) { - $decryptedPassword = openssl_decrypt($password, 'DES-CBC', $secret, OPENSSL_ZERO_PADDING); + $decryptedPassword = openssl_decrypt($password, 'DES-CBC', substr($secret, 0, 8), OPENSSL_ZERO_PADDING); } /* Check decrypted password. Judge whether there is garbled code. */ diff --git a/framework/router.class.php b/framework/router.class.php index e1df5c32c8..55b7f0f1b9 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -513,12 +513,7 @@ class router extends baseRouter if($methodName == 'batchOperate') array_unshift($params, $this->rawMethod); // $params = array('close', 1); if($methodName == 'browse') { - if(isset($params[0]) and $params[0] == 'bysearch') - { - $params[0] = ''; - array_unshift($params, 'bysearch'); - } - else + if(!(isset($params[0]) and $params[0] == 'bysearch')) { array_unshift($params, 'browse'); }