forked from extern/egroupware
replaced depricated mcrypt_generic_end, which 4.1.1+ mcrypt_generic_deinit, as it gaves warnings in php5
This commit is contained in:
parent
7ddeb1010f
commit
809bbaccda
@ -79,22 +79,17 @@
|
|||||||
$key = substr($key, 0, mcrypt_enc_get_key_size($GLOBALS['td']));
|
$key = substr($key, 0, mcrypt_enc_get_key_size($GLOBALS['td']));
|
||||||
|
|
||||||
mcrypt_generic_init($GLOBALS['td'], $key, $iv);
|
mcrypt_generic_init($GLOBALS['td'], $key, $iv);
|
||||||
$p_t = trim(mdecrypt_generic($GLOBALS['td'], $c_t)); //trim to remove padding
|
$p_t = mdecrypt_generic($GLOBALS['td'], $c_t);
|
||||||
|
|
||||||
/* Clean up */
|
/* Clean up */
|
||||||
mcrypt_generic_end($GLOBALS['td']);
|
mcrypt_generic_deinit($GLOBALS['td']);
|
||||||
mcrypt_module_close($GLOBALS['td']);
|
mcrypt_module_close($GLOBALS['td']);
|
||||||
}
|
}
|
||||||
@mcrypt_module_close($GLOBALS['td']);
|
|
||||||
|
|
||||||
if(strncmp($p_t, $plain_text, strlen($plain_text)) == 0)
|
|
||||||
{
|
|
||||||
return True;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return False;
|
@mcrypt_module_close($GLOBALS['td']);
|
||||||
}
|
}
|
||||||
|
return rtrim($p_t) === $plain_text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* run a self-test through every listed cipher and mode - from robert at peakepro dot com (php.net manual) */
|
/* run a self-test through every listed cipher and mode - from robert at peakepro dot com (php.net manual) */
|
||||||
|
Loading…
Reference in New Issue
Block a user