mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Fix: encrypt key don't exist in install mode
This commit is contained in:
@@ -688,17 +688,17 @@ class DoliDb
|
||||
*/
|
||||
function encrypt($fieldorvalue, $cryptType=0, $cryptKey='', $withQuotes=0)
|
||||
{
|
||||
$return = $fieldorvalue;
|
||||
$return = ($withQuotes?"'":"").addslashes($fieldorvalue).($withQuotes?"'":"");
|
||||
|
||||
if ($cryptType && !empty($cryptKey))
|
||||
{
|
||||
if ($cryptType == 2)
|
||||
{
|
||||
$return = 'AES_ENCRYPT('.($withQuotes?"'":"").addslashes($fieldorvalue).($withQuotes?"'":"").',\''.$cryptKey.'\')';
|
||||
$return = 'AES_ENCRYPT('.$return.',\''.$cryptKey.'\')';
|
||||
}
|
||||
else if ($cryptType == 1)
|
||||
{
|
||||
$return = 'DES_ENCRYPT('.($withQuotes?"'":"").addslashes($fieldorvalue).($withQuotes?"'":"").',\''.$cryptKey.'\')';
|
||||
$return = 'DES_ENCRYPT('.$return.',\''.$cryptKey.'\')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user