-
Notifications
You must be signed in to change notification settings - Fork 203
Open
Description
protected static function _decryptMsg($body, $encodeKey)
{
$enc_msg = base64_decode($body);
$aes_key = base64_decode($encodeKey . '=');
$secure_key = substr($aes_key, 0, 32);
$iv = substr($aes_key, 0, 16);
$msg = openssl_decrypt($enc_msg, 'AES-256-CBC', $secure_key, OPENSSL_RAW_DATA, $iv);
//$pattern = '/.*(\{.*\})/'; //原正则
$pattern = "/[^\{]*(\{.*\})/i";
$msg = preg_replace($pattern, '${1}', $msg);
return $msg;
}
Metadata
Metadata
Assignees
Labels
No labels