From 44b9b77e9915c5fed10e170bb50baca785b38f13 Mon Sep 17 00:00:00 2001 From: Drake Panzer Date: Sat, 24 Oct 2020 18:43:24 -0600 Subject: [PATCH] c --- includes/SpecialContact.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/includes/SpecialContact.php b/includes/SpecialContact.php index 532d140..870bc41 100644 --- a/includes/SpecialContact.php +++ b/includes/SpecialContact.php @@ -292,12 +292,14 @@ class SpecialContact extends UnlistedSpecialPage $text = ''; + + // add main fields + $text .= "Email: {$fromAddress}
Name: {$fromName}
IP:{$senderIP}

Subject: {$msgSubject}
"; + foreach ($config['AdditionalFields'] as $name => $field) { $class = HTMLForm::getClassFromDescriptor($name, $field); $value = ''; - // TODO: Support selectandother/HTMLSelectAndOtherField - // options, options-messages and options-message if (isset($field['options-messages'])) { // Multiple values! if (is_string($formData[$name])) { $optionValues = array_flip($field['options-messages']); @@ -348,6 +350,9 @@ class SpecialContact extends UnlistedSpecialPage } $text .= "{$name}: $value\n"; + + // lazily remove the string "::" which is caused by localization shit + $text = str_replace("::", ":", $text); } // Stolen from Special:EmailUser @@ -370,18 +375,12 @@ class SpecialContact extends UnlistedSpecialPage ' replyto ' . ($replyTo == null ? '-/-' : $replyTo->toString()) . "\n" ); - // remove the string "::" which is caused by localization shit - $text = str_replace("::", ":", $text); - $mailResult = UserMailer::send( $contactRecipientAddress, $senderAddress, $subject, $text, - [ - 'replyTo' => $replyTo, - 'contentType' => 'text/html' - ] + ['replyTo' => $replyTo, 'contentType' => 'text/html'] ); if (!$mailResult->isOK()) {