aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_email.html4
-rw-r--r--phpBB/includes/acp/acp_email.php45
-rw-r--r--phpBB/includes/acp/acp_icons.php4
-rw-r--r--phpBB/includes/functions_user.php12
-rw-r--r--phpBB/includes/message_parser.php35
-rw-r--r--phpBB/language/en/acp/email.php6
-rw-r--r--phpBB/language/en/acp/posting.php5
7 files changed, 76 insertions, 35 deletions
diff --git a/phpBB/adm/style/acp_email.html b/phpBB/adm/style/acp_email.html
index 885809ffe2..ff52500dca 100644
--- a/phpBB/adm/style/acp_email.html
+++ b/phpBB/adm/style/acp_email.html
@@ -39,6 +39,10 @@
<dd><select id="priority" name="mail_priority_flag">{S_PRIORITY_OPTIONS}</select></dd>
</dl>
<dl>
+ <dt><label for="banned">{L_MAIL_BANNED}:</label><br /><span>{L_MAIL_BANNED_EXPLAIN}</span></dt>
+ <dd><input id="banned" name="mail_banned_flag" type="checkbox" class="radio" /></dd>
+</dl>
+<dl>
<dt><label for="send">{L_SEND_IMMEDIATELY}:</label></dt>
<dd><input id="send" type="checkbox" class="radio" name="send_immediately" checked="checked" /></dd>
</dl>
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index 350693a630..133fe47e09 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -82,23 +82,48 @@ class acp_email
{
if ($group_id)
{
- $sql = 'SELECT u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type
- FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug
- WHERE ug.group_id = ' . $group_id . '
+ $sql_ary = array(
+ 'SELECT' => 'u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type',
+ 'FROM' => array(
+ USERS_TABLE => 'u',
+ USER_GROUP_TABLE => 'ug',
+ ),
+ 'WHERE' => 'ug.group_id = ' . $group_id . '
AND ug.user_pending = 0
AND u.user_id = ug.user_id
AND u.user_allow_massemail = 1
- AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
- ORDER BY u.user_lang, u.user_notify_type';
+ AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')',
+ 'ORDER_BY' => 'u.user_lang, u.user_notify_type',
+ );
}
else
{
- $sql = 'SELECT username, username_clean, user_email, user_jabber, user_notify_type, user_lang
- FROM ' . USERS_TABLE . '
- WHERE user_allow_massemail = 1
- AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')
- ORDER BY user_lang, user_notify_type';
+ $sql_ary = array(
+ 'SELECT' => 'u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type',
+ 'FROM' => array(
+ USERS_TABLE => 'u',
+ ),
+ 'WHERE' => 'u.user_allow_massemail = 1
+ AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')',
+ 'ORDER_BY' => 'u.user_lang, u.user_notify_type',
+ );
}
+
+ // Mail banned or not
+ if (!isset($_REQUEST['mail_banned_flag']))
+ {
+ $sql_ary['WHERE'] .= ' AND (b.ban_id IS NULL
+ OR b.ban_exclude = 1)';
+ $sql_ary['LEFT_JOIN'] = array(
+ array(
+ 'FROM' => array(
+ BANLIST_TABLE => 'b',
+ ),
+ 'ON' => 'u.user_id = b.ban_userid',
+ ),
+ );
+ }
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
}
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 3d64a2acda..24f6cbbcbf 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -394,6 +394,10 @@ class acp_icons
{
// skip images where add wasn't checked
}
+ else if (!file_exists($phpbb_root_path . $img_path . '/' . $image))
+ {
+ $errors[$image] = 'SMILIE_NO_FILE';
+ }
else
{
if ($image_width[$image] == 0 || $image_height[$image] == 0)
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 89ce52dc39..6b5cca8abb 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -733,7 +733,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
}
else
{
- trigger_error('LENGTH_BAN_INVALID');
+ trigger_error('LENGTH_BAN_INVALID', E_USER_WARNING);
}
}
}
@@ -793,7 +793,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
// Make sure we have been given someone to ban
if (!sizeof($sql_usernames))
{
- trigger_error('NO_USER_SPECIFIED');
+ trigger_error('NO_USER_SPECIFIED', E_USER_WARNING);
}
$sql = 'SELECT user_id
@@ -824,7 +824,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
else
{
$db->sql_freeresult($result);
- trigger_error('NO_USERS');
+ trigger_error('NO_USERS', E_USER_WARNING);
}
$db->sql_freeresult($result);
break;
@@ -926,7 +926,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
if (empty($banlist_ary))
{
- trigger_error('NO_IPS_DEFINED');
+ trigger_error('NO_IPS_DEFINED', E_USER_WARNING);
}
}
break;
@@ -954,12 +954,12 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
if (sizeof($ban_list) == 0)
{
- trigger_error('NO_EMAILS_DEFINED');
+ trigger_error('NO_EMAILS_DEFINED', E_USER_WARNING);
}
break;
default:
- trigger_error('NO_MODE');
+ trigger_error('NO_MODE', E_USER_WARNING);
break;
}
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index b2d0b6c566..6951dcf820 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -110,19 +110,19 @@ class bbcode_firstpass extends bbcode
// order, so it is important to keep [code] in first position and
// [quote] in second position.
$this->bbcodes = array(
- 'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#ise' => "\$this->bbcode_code('\$1', '\$2')")),
- 'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:=&quot;(.*?)&quot;)?\](.+)\[/quote\]#ise' => "\$this->bbcode_quote('\$0')")),
- 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#ise' => "\$this->bbcode_attachment('\$1', '\$2')")),
- 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#ise' => "\$this->bbcode_strong('\$1')")),
- 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#ise' => "\$this->bbcode_italic('\$1')")),
- 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")),
- 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#iUe' => "\$this->bbcode_img('\$1')")),
- 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")),
- 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")),
- 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#ise' => "\$this->bbcode_underline('\$1')")),
- 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#ise' => "\$this->bbcode_parse_list('\$0')")),
- 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#ise' => "\$this->validate_email('\$1', '\$2')")),
- 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')"))
+ 'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uise' => "\$this->bbcode_code('\$1', '\$2')")),
+ 'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:=&quot;(.*?)&quot;)?\](.+)\[/quote\]#uise' => "\$this->bbcode_quote('\$0')")),
+ 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uise' => "\$this->bbcode_attachment('\$1', '\$2')")),
+ 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#uise' => "\$this->bbcode_strong('\$1')")),
+ 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#uise' => "\$this->bbcode_italic('\$1')")),
+ 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#uiUe' => "\$this->validate_url('\$2', '\$3')")),
+ 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#uiUe' => "\$this->bbcode_img('\$1')")),
+ 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#uise' => "\$this->bbcode_size('\$1', '\$2')")),
+ 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!uise' => "\$this->bbcode_color('\$1', '\$2')")),
+ 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#uise' => "\$this->bbcode_underline('\$1')")),
+ 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#uise' => "\$this->bbcode_parse_list('\$0')")),
+ 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#uise' => "\$this->validate_email('\$1', '\$2')")),
+ 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#uie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')"))
);
// Zero the parsed items array
@@ -1332,7 +1332,9 @@ class parse_message extends bbcode_firstpass
{
if ($max_smilies)
{
- $num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#', $this->message, $matches);
+ // 'u' modifier has been added to correctly parse smilies within unicode strings
+ // For details: http://tracker.phpbb.com/browse/PHPBB3-10117
+ $num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#u', $this->message, $matches);
unset($matches);
if ($num_matches !== false && $num_matches > $max_smilies)
@@ -1343,7 +1345,10 @@ class parse_message extends bbcode_firstpass
}
// Make sure the delimiter # is added in front and at the end of every element within $match
- $this->message = trim(preg_replace(explode(chr(0), '#(?<=^|[\n .])' . implode('(?![^<>]*>)#' . chr(0) . '#(?<=^|[\n .])', $match) . '(?![^<>]*>)#'), $replace, $this->message));
+ // 'u' modifier has been added to correctly parse smilies within unicode strings
+ // For details: http://tracker.phpbb.com/browse/PHPBB3-10117
+
+ $this->message = trim(preg_replace(explode(chr(0), '#(?<=^|[\n .])' . implode('(?![^<>]*>)#u' . chr(0) . '#(?<=^|[\n .])', $match) . '(?![^<>]*>)#u'), $replace, $this->message));
}
}
diff --git a/phpBB/language/en/acp/email.php b/phpBB/language/en/acp/email.php
index 4427bfff01..38c9f19c27 100644
--- a/phpBB/language/en/acp/email.php
+++ b/phpBB/language/en/acp/email.php
@@ -52,14 +52,16 @@ $lang = array_merge($lang, array(
'SEND_TO_GROUP' => 'Send to group',
'SEND_TO_USERS' => 'Send to users',
'SEND_TO_USERS_EXPLAIN' => 'Entering names here will override any group selected above. Enter each username on a new line.',
-
+
+ 'MAIL_BANNED' => 'Mail banned users',
+ 'MAIL_BANNED_EXPLAIN' => 'When sending a mass e-mail to a group you can select here whether banned users will also receive the e-mail.',
'MAIL_HIGH_PRIORITY' => 'High',
'MAIL_LOW_PRIORITY' => 'Low',
'MAIL_NORMAL_PRIORITY' => 'Normal',
'MAIL_PRIORITY' => 'Mail priority',
'MASS_MESSAGE' => 'Your message',
'MASS_MESSAGE_EXPLAIN' => 'Please note that you may enter only plain text. All markup will be removed before sending.',
-
+
'NO_EMAIL_MESSAGE' => 'You must enter a message.',
'NO_EMAIL_SUBJECT' => 'You must specify a subject for your message.',
));
diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php
index 25152dd766..9719287c2a 100644
--- a/phpBB/language/en/acp/posting.php
+++ b/phpBB/language/en/acp/posting.php
@@ -168,8 +168,9 @@ $lang = array_merge($lang, array(
'SMILIES_CONFIG' => 'Smiley configuration',
'SMILIES_DELETED' => 'The smiley has been removed successfully.',
'SMILIES_EDIT' => 'Edit smiley',
- 'SMILIE_NO_CODE' => 'The smilie “%s” was ignored, as there was no code entered.',
- 'SMILIE_NO_EMOTION' => 'The smilie “%s” was ignored, as there was no emotion entered.',
+ 'SMILIE_NO_CODE' => 'The smiley “%s” was ignored, as there was no code entered.',
+ 'SMILIE_NO_EMOTION' => 'The smiley “%s” was ignored, as there was no emotion entered.',
+ 'SMILIE_NO_FILE' => 'The smiley “%s” was ignored, as the file is missing.',
'SMILIES_NONE_EDITED' => 'No smilies were updated.',
'SMILIES_ONE_EDITED' => 'The smiley has been updated successfully.',
'SMILIES_EDITED' => 'The smilies have been updated successfully.',