Fix: encrypt key don't exist in install mode
This commit is contained in:
parent
c19df2514d
commit
11b92539d6
@ -688,17 +688,17 @@ class DoliDb
|
|||||||
*/
|
*/
|
||||||
function encrypt($fieldorvalue, $cryptType=0, $cryptKey='', $withQuotes=0)
|
function encrypt($fieldorvalue, $cryptType=0, $cryptKey='', $withQuotes=0)
|
||||||
{
|
{
|
||||||
$return = $fieldorvalue;
|
$return = ($withQuotes?"'":"").addslashes($fieldorvalue).($withQuotes?"'":"");
|
||||||
|
|
||||||
if ($cryptType && !empty($cryptKey))
|
if ($cryptType && !empty($cryptKey))
|
||||||
{
|
{
|
||||||
if ($cryptType == 2)
|
if ($cryptType == 2)
|
||||||
{
|
{
|
||||||
$return = 'AES_ENCRYPT('.($withQuotes?"'":"").addslashes($fieldorvalue).($withQuotes?"'":"").',\''.$cryptKey.'\')';
|
$return = 'AES_ENCRYPT('.$return.',\''.$cryptKey.'\')';
|
||||||
}
|
}
|
||||||
else if ($cryptType == 1)
|
else if ($cryptType == 1)
|
||||||
{
|
{
|
||||||
$return = 'DES_ENCRYPT('.($withQuotes?"'":"").addslashes($fieldorvalue).($withQuotes?"'":"").',\''.$cryptKey.'\')';
|
$return = 'DES_ENCRYPT('.$return.',\''.$cryptKey.'\')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user