mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Throw exception if neither openssl nor mcrypt is available
This commit is contained in:
parent
75a468552d
commit
4b6737800f
3 changed files with 18 additions and 2 deletions
|
|
@ -64,7 +64,14 @@ class Security
|
|||
}
|
||||
|
||||
// Otherwise, use the CryptoCompat class.
|
||||
return base64_encode(\CryptoCompat::encrypt($plaintext, $key));
|
||||
if (function_exists('mcrypt_encrypt'))
|
||||
{
|
||||
return base64_encode(\CryptoCompat::encrypt($plaintext, $key));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception('msg_crypto_not_available');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -102,7 +109,14 @@ class Security
|
|||
}
|
||||
|
||||
// Otherwise, use the CryptoCompat class.
|
||||
return \CryptoCompat::decrypt($ciphertext, $key);
|
||||
if (function_exists('mcrypt_decrypt'))
|
||||
{
|
||||
return \CryptoCompat::decrypt($ciphertext, $key);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception('msg_crypto_not_available');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -246,6 +246,7 @@ $lang->msg_empty_search_keyword = 'Cannot find the Keyword.';
|
|||
$lang->msg_empty_content = 'The content is empty.';
|
||||
$lang->msg_server_error = 'Server Error';
|
||||
$lang->msg_server_error_see_log = 'Your server is configured to hide error messages. Please see your server\'s error log for details.';
|
||||
$lang->msg_crypto_not_available = 'OpenSSL extension is not installed.';
|
||||
$lang->comment_to_be_approved = 'Your comment must be approved by admin before being published.';
|
||||
$lang->success_registed = 'Registered successfully.';
|
||||
$lang->success_declared = 'Reported successfully.';
|
||||
|
|
|
|||
|
|
@ -246,6 +246,7 @@ $lang->msg_empty_search_keyword = '검색어가 없습니다.';
|
|||
$lang->msg_empty_content = '내용이 없습니다.';
|
||||
$lang->msg_server_error = '서버 오류';
|
||||
$lang->msg_server_error_see_log = '오류 메시지를 표시하지 않도록 설정되어 있습니다. 서버의 에러 로그에서 자세한 내용을 확인해 주십시오.';
|
||||
$lang->msg_crypto_not_available = 'openssl 확장모듈이 설치되어 있지 않습니다.';
|
||||
$lang->comment_to_be_approved = '관리자의 확인이 필요한 댓글입니다.';
|
||||
$lang->success_registed = '등록했습니다.';
|
||||
$lang->success_declared = '신고했습니다.';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue