- $sender_name = '"' . L10n::t('%1$s, %2$s Administrator', $a->config['admin_name'], $sitename) . '"';
+ $sender_name = '"' . L10n::t('%1$s, %2$s Administrator', Config::get('config', 'admin_name'), $sitename) . '"';
- if (! x($a->config['sender_email']))
- {
- $sender_email = 'noreply@' . $a->get_hostname();
+ if (!Config::get('config', 'sender_email')) {
+ $sender_email = 'noreply@' . $a->getHostName();
// if this is a test, send it only to the admin(s)
// admin_email might be a comma separated list, but we need "a@b','c@d','e@f
// if this is a test, send it only to the admin(s)
// admin_email might be a comma separated list, but we need "a@b','c@d','e@f
- if (intval($_REQUEST['test']))
- {
- $email = $a->config['admin_email'];
+ if (intval($_REQUEST['test'])) {
+ $email = Config::get('config', 'admin_email');
$email = "'" . str_replace([" ",","], ["","','"], $email) . "'";
}
$sql_extra = ((intval($_REQUEST['test'])) ? sprintf(" AND `email` in ( %s )", $email) : '');
$recips = q("SELECT DISTINCT `email` FROM `user` WHERE `verified` AND NOT `account_removed` AND NOT `account_expired` $sql_extra");
$email = "'" . str_replace([" ",","], ["","','"], $email) . "'";
}
$sql_extra = ((intval($_REQUEST['test'])) ? sprintf(" AND `email` in ( %s )", $email) : '');
$recips = q("SELECT DISTINCT `email` FROM `user` WHERE `verified` AND NOT `account_removed` AND NOT `account_expired` $sql_extra");
Emailer::send([
'fromName' => $sender_name,
'fromEmail' => $sender_email,
Emailer::send([
'fromName' => $sender_name,
'fromEmail' => $sender_email,
- '$text' => htmlspecialchars($_REQUEST['text']),
- '$subject' => ['subject',L10n::t('Message subject'),$_REQUEST['subject'],''],
+ '$text' => htmlspecialchars(defaults($_REQUEST, 'text', '')),
+ '$subject' => ['subject', L10n::t('Message subject'), defaults($_REQUEST, 'subject', ''),''],
'$test' => ['test',L10n::t('Test mode (only send to administrator)'), 0,''],
'$submit' => L10n::t('Submit')
]);
'$test' => ['test',L10n::t('Test mode (only send to administrator)'), 0,''],
'$submit' => L10n::t('Submit')
]);