Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mcrypt warning except for affected sites. #12733

Merged
merged 1 commit into from
Aug 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CRM/Utils/Check/Component/Env.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,21 @@ public function checkPhpMysqli() {
*/
public function checkPhpEcrypt() {
$messages = array();
$mailingBackend = Civi::settings()->get('mailing_backend');
if (!is_array($mailingBackend)
|| !isset($mailingBackend['outBound_option'])
|| $mailingBackend['outBound_option'] != CRM_Mailing_Config::OUTBOUND_OPTION_SMTP
|| !CRM_Utils_Array::value('smtpAuth', $mailingBackend)
) {
return $messages;
}

$test_pass = 'iAmARandomString';
$encrypted_test_pass = CRM_Utils_Crypt::encrypt($test_pass);
if ($encrypted_test_pass == base64_encode($test_pass)) {
$messages[] = new CRM_Utils_Check_Message(
__FUNCTION__,
ts('Your PHP does not include the recommended encryption functions. Some passwords will not be stored encrypted, and if you have recently upgraded from a PHP that does include these functions, your encrypted passwords will not be decrypted correctly. If you are using PHP 7.0 or earlier, you probably want to include the "%1" extension.',
array('1' => 'mcrypt')
ts('Your PHP does not include the mcrypt encryption functions. Your SMTP password will not be stored encrypted, and if you have recently upgraded from a PHP that stored it with encryption, it will not be decrypted correctly.'
),
ts('PHP Missing Extension "mcrypt"'),
\Psr\Log\LogLevel::WARNING,
Expand Down