mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 02:11:27 +01:00
Fix: Serious bug with encrypt and decrypt function.
This commit is contained in:
@@ -696,13 +696,13 @@ class DoliDb
|
||||
* \param fieldorvalue Field name or value to encrypt
|
||||
* \param cryptType Type of encryption (2: AES (recommended), 1: DES , 0: no encryption)
|
||||
* \param cryptKey Encryption key
|
||||
* \param isAValue String in field can be a field name or a value
|
||||
* \param withQuotes Return string with quotes
|
||||
* \return return XXX(field) or XXX('value') or field or 'value'
|
||||
*/
|
||||
function encrypt($fieldorvalue, $cryptType=0, $cryptKey='', $isAValue=0)
|
||||
function encrypt($fieldorvalue, $cryptType=0, $cryptKey='', $withQuotes=0)
|
||||
{
|
||||
$return = $fieldorvalue;
|
||||
return ($isAValue?"'":"").$return.($isAValue?"'":"");
|
||||
return ($withQuotes?"'":"").$return.($withQuotes?"'":"");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user