Merge pull request #601 from tobiasd/20180513-4976

notifyall: enclose senders name in quotation marks
pull/604/head
Hypolite Petovan 2018-05-14 16:08:36 -04:00 committed by GitHub
commit a2203e3d09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 13 deletions

View File

@ -11,42 +11,51 @@
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Util\Emailer; use Friendica\Util\Emailer;
use Friendica\App;
function notifyall_install() { function notifyall_install()
{
logger("installed notifyall"); logger("installed notifyall");
} }
function notifyall_uninstall() { function notifyall_uninstall()
{
logger("removed notifyall"); logger("removed notifyall");
} }
function notifyall_module() {} function notifyall_module() {}
function notifyall_addon_admin(&$a, &$o) { function notifyall_addon_admin(App $a, &$o)
{
$o = '<div></div>&nbsp;&nbsp;&nbsp;&nbsp;<a href="' . z_root() . '/notifyall">' . L10n::t('Send email to all members') . '</a></br/>'; $o = '<div></div>&nbsp;&nbsp;&nbsp;&nbsp;<a href="' . z_root() . '/notifyall">' . L10n::t('Send email to all members') . '</a></br/>';
} }
function notifyall_post(&$a) { function notifyall_post(App $a)
if(! is_site_admin()) {
if(!is_site_admin()) {
return; return;
}
$text = trim($_REQUEST['text']); $text = trim($_REQUEST['text']);
if(! $text)
if(! $text) {
return; return;
}
$sitename = $a->config['sitename']; $sitename = $a->config['sitename'];
if (!x($a->config['admin_name'])) if (empty($a->config['admin_name'])) {
$sender_name = L10n::t('%s Administrator', $sitename); $sender_name = '"' . L10n::t('%s Administrator', $sitename) . '"';
else } else {
$sender_name = L10n::t('%1$s, %2$s Administrator', $a->config['admin_name'], $sitename); $sender_name = '"' . L10n::t('%1$s, %2$s Administrator', $a->config['admin_name'], $sitename) . '"';
}
if (! x($a->config['sender_email'])) if (! x($a->config['sender_email'])) {
$sender_email = 'noreply@' . $a->get_hostname(); $sender_email = 'noreply@' . $a->get_hostname();
else } else {
$sender_email = $a->config['sender_email']; $sender_email = $a->config['sender_email'];
}
$subject = $_REQUEST['subject']; $subject = $_REQUEST['subject'];