This commit is contained in:
parent
57c7fcc47a
commit
44b9b77e99
|
@ -292,12 +292,14 @@ class SpecialContact extends UnlistedSpecialPage
|
|||
|
||||
|
||||
$text = '';
|
||||
|
||||
// add main fields
|
||||
$text .= "<b>Email:</b> {$fromAddress}<br><b>Name:</b> {$fromName}<br><b>IP:</b>{$senderIP}<br><br><b>Subject:</b> {$msgSubject}<br>";
|
||||
|
||||
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 .= "<b>{$name}</b>: $value\n";
|
||||
|
||||
// lazily remove the string "::" which is caused by localization shit
|
||||
$text = str_replace(":</b>:", ":", $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()) {
|
||||
|
|
Loading…
Reference in New Issue