base64 encoding for crypted data, fixes jpegPhoto problems

This commit is contained in:
Roland Gruber 2006-01-24 14:22:39 +00:00
parent b5f3813c83
commit 35a0fac1ab
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
??? 1.0.rc2
- fixed bugs:
-> changed check for mail addresses (patch 1403922)
-> fixed JPG upload when MCrypt is enabled
09.01.2006 1.0.rc1
@ -9,6 +10,7 @@
- fixed bugs:
-> Samba groups: editing of special groups fixed
14.12.2005 0.5.3
- accounts are now deleted with subentries
- big update for Italian translation

View File

@ -359,7 +359,7 @@ class Ldap{
$iv = base64_decode($_COOKIE["IV"]);
$key = base64_decode($_COOKIE["Key"]);
// encrypt string
return mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $data, MCRYPT_MODE_ECB, $iv);
return mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, base64_encode($data), MCRYPT_MODE_ECB, $iv);
}
// otherwise do not encrypt
else {
@ -381,7 +381,7 @@ class Ldap{
$key = base64_decode($_COOKIE["Key"]);
// decrypt string
$ret = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $data, MCRYPT_MODE_ECB, $iv);
$ret = str_replace(chr(00), "", $ret);
$ret = base64_decode(str_replace(chr(00), "", $ret));
return $ret;
}
// otherwise do not decrypt