@@ -167,8 +167,9 @@ discard block |
||
167 | 167 | if ($messageClass !== 'IPM.Note.SMIME' && |
168 | 168 | $messageClass !== 'IPM.Note.SMIME.SignedEncrypt' && |
169 | 169 | $messageClass !== 'IPM.Note.deferSMIME' && |
170 | - $messageClass !== 'IPM.Note.deferSMIME.SignedEncrypt') |
|
171 | - return; |
|
170 | + $messageClass !== 'IPM.Note.deferSMIME.SignedEncrypt') { |
|
171 | + return; |
|
172 | + } |
|
172 | 173 | |
173 | 174 | $recipients = $data['action']['props']['smime']; |
174 | 175 | $missingCerts = []; |
@@ -303,8 +304,9 @@ discard block |
||
303 | 304 | $importCert = file_get_contents($outcert); |
304 | 305 | $parsedImportCert = openssl_x509_parse($importCert); |
305 | 306 | $parsedUserCert = openssl_x509_parse($userCert); |
306 | - if (!$signed_ok || $openssl_error_code === OPENSSL_CA_VERIFY_FAIL) |
|
307 | - continue; |
|
307 | + if (!$signed_ok || $openssl_error_code === OPENSSL_CA_VERIFY_FAIL) { |
|
308 | + continue; |
|
309 | + } |
|
308 | 310 | |
309 | 311 | // CA Checks out |
310 | 312 | $caCerts = $this->extractCAs($tmpfname); |
@@ -549,8 +551,9 @@ discard block |
||
549 | 551 | * @param mixed $data |
550 | 552 | */ |
551 | 553 | public function onUploadCertificate($data) { |
552 | - if ($data['sourcetype'] !== 'certificate') |
|
553 | - return; |
|
554 | + if ($data['sourcetype'] !== 'certificate') { |
|
555 | + return; |
|
556 | + } |
|
554 | 557 | $passphrase = $_POST['passphrase']; |
555 | 558 | $saveCert = false; |
556 | 559 | $tmpname = $data['tmpname']; |
@@ -625,11 +628,13 @@ discard block |
||
625 | 628 | $props = mapi_getprops($message, [PR_MESSAGE_CLASS]); |
626 | 629 | $messageClass = $props[PR_MESSAGE_CLASS]; |
627 | 630 | |
628 | - if (!isset($messageClass)) |
|
629 | - return; |
|
631 | + if (!isset($messageClass)) { |
|
632 | + return; |
|
633 | + } |
|
630 | 634 | if (stripos($messageClass, 'IPM.Note.deferSMIME') === false && |
631 | - stripos($messageClass, 'IPM.Note.SMIME') === false) |
|
632 | - return; |
|
635 | + stripos($messageClass, 'IPM.Note.SMIME') === false) { |
|
636 | + return; |
|
637 | + } |
|
633 | 638 | |
634 | 639 | // FIXME: for now return when we are going to sign but we don't have the passphrase set |
635 | 640 | // This should never happen sign |
@@ -638,8 +643,9 @@ discard block |
||
638 | 643 | $messageClass === 'IPM.Note.deferSMIME.MultipartSigned' || |
639 | 644 | $messageClass === 'IPM.Note.SMIME.SignedEncrypt' || |
640 | 645 | $messageClass === 'IPM.Note.SMIME.MultipartSigned') && |
641 | - !$encryptionStore->get('smime')) |
|
642 | - return; |
|
646 | + !$encryptionStore->get('smime')) { |
|
647 | + return; |
|
648 | + } |
|
643 | 649 | // NOTE: setting message class to IPM.Note, so that mapi_inetmapi_imtoinet converts the message to plain email |
644 | 650 | // and doesn't fail when handling the attachments. |
645 | 651 | mapi_setprops($message, [PR_MESSAGE_CLASS => 'IPM.Note']); |
@@ -883,8 +889,9 @@ discard block |
||
883 | 889 | foreach ($certs as $cert) { |
884 | 890 | $pubkey = mapi_msgstore_openentry($this->getStore(), $cert[PR_ENTRYID]); |
885 | 891 | $certificate = ""; |
886 | - if ($pubkey == false) |
|
887 | - continue; |
|
892 | + if ($pubkey == false) { |
|
893 | + continue; |
|
894 | + } |
|
888 | 895 | // retrieve pkcs#11 certificate from body |
889 | 896 | $stream = mapi_openproperty($pubkey, PR_BODY, IID_IStream, 0, 0); |
890 | 897 | $stat = mapi_stream_stat($stream); |
@@ -1006,8 +1013,9 @@ discard block |
||
1006 | 1013 | */ |
1007 | 1014 | public function importCertificate($cert, $certData, $type = 'public', $force = false) { |
1008 | 1015 | $certEmail = getCertEmail($certData); |
1009 | - if ($this->pubcertExists($certEmail) && !$force && $type !== 'private') |
|
1010 | - return; |
|
1016 | + if ($this->pubcertExists($certEmail) && !$force && $type !== 'private') { |
|
1017 | + return; |
|
1018 | + } |
|
1011 | 1019 | $issued_by = ""; |
1012 | 1020 | foreach (array_keys($certData['issuer']) as $key) { |
1013 | 1021 | $issued_by .= $key . '=' . $certData['issuer'][$key] . "\n"; |
@@ -1131,8 +1139,9 @@ discard block |
||
1131 | 1139 | * @return array with properties |
1132 | 1140 | */ |
1133 | 1141 | public function getSenderAddress($mapiMessage) { |
1134 | - if (method_exists($GLOBALS['operations'], 'getSenderAddress')) |
|
1135 | - return $GLOBALS["operations"]->getSenderAddress($mapiMessage); |
|
1142 | + if (method_exists($GLOBALS['operations'], 'getSenderAddress')) { |
|
1143 | + return $GLOBALS["operations"]->getSenderAddress($mapiMessage); |
|
1144 | + } |
|
1136 | 1145 | |
1137 | 1146 | $messageProps = mapi_getprops($mapiMessage, [PR_SENT_REPRESENTING_ENTRYID, PR_SENDER_ENTRYID]); |
1138 | 1147 | $senderEntryID = isset($messageProps[PR_SENT_REPRESENTING_ENTRYID]) ? $messageProps[PR_SENT_REPRESENTING_ENTRYID] : $messageProps[PR_SENDER_ENTRYID]; |