aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_attachments.php2
-rw-r--r--phpBB/includes/acp/acp_board.php4
-rw-r--r--phpBB/includes/acp/acp_main.php2
-rw-r--r--phpBB/includes/acp/acp_search.php10
-rw-r--r--phpBB/includes/acp/acp_styles.php1
-rw-r--r--phpBB/includes/constants.php2
-rw-r--r--phpBB/includes/functions.php21
-rw-r--r--phpBB/includes/functions_acp.php5
-rw-r--r--phpBB/includes/functions_content.php26
-rw-r--r--phpBB/includes/functions_posting.php4
-rw-r--r--phpBB/includes/functions_url_matcher.php22
-rw-r--r--phpBB/includes/mcp/mcp_reports.php12
-rw-r--r--phpBB/includes/message_parser.php16
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php17
14 files changed, 90 insertions, 54 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 1aaf1f9c09..03d3e0f85f 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -1222,7 +1222,7 @@ class acp_attachments
'ATTACHMENT_POSTER' => get_username_string('full', (int) $row['poster_id'], (string) $row['username'], (string) $row['user_colour'], (string) $row['username']),
'FILESIZE' => get_formatted_filesize((int) $row['filesize']),
'FILETIME' => $user->format_date((int) $row['filetime']),
- 'REAL_FILENAME' => (!$row['in_message']) ? utf8_wordwrap(utf8_basename((string) $row['real_filename']), 40, '<br />', true) : '',
+ 'REAL_FILENAME' => (!$row['in_message']) ? utf8_basename((string) $row['real_filename']) : '',
'PHYSICAL_FILENAME' => utf8_basename((string) $row['physical_filename']),
'EXT_GROUP_NAME' => (!empty($extensions[$row['extension']]['group_name'])) ? $user->lang['EXT_GROUP_' . $extensions[$row['extension']]['group_name']] : '',
'COMMENT' => $comment,
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index cf0f23a16e..f054e82de3 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -363,7 +363,7 @@ class acp_board
'title' => 'ACP_AUTH_SETTINGS',
'vars' => array(
'legend1' => 'ACP_AUTH_SETTINGS',
- 'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'select_auth_method', 'explain' => false),
+ 'auth_method' => array('lang' => 'AUTH_METHOD', 'validate' => 'string', 'type' => 'select:1:toggable', 'method' => 'select_auth_method', 'explain' => false),
)
);
break;
@@ -715,7 +715,7 @@ class acp_board
foreach ($auth_plugins as $method)
{
$selected = ($selected_method == $method) ? ' selected="selected"' : '';
- $auth_select .= '<option value="' . $method . '"' . $selected . '>' . ucfirst($method) . '</option>';
+ $auth_select .= "<option value=\"$method\"$selected data-toggle-setting=\"#auth_{$method}_settings\">" . ucfirst($method) . '</option>';
}
return $auth_select;
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 9c1613e24a..74ea095496 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -349,7 +349,7 @@ class acp_main
break;
case 'purge_cache':
- global $cache;
+ $config->increment('assets_version', 1);
$cache->purge();
// Clear permissions
diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php
index 11a2511aee..ce1e4afa9b 100644
--- a/phpBB/includes/acp/acp_search.php
+++ b/phpBB/includes/acp/acp_search.php
@@ -79,7 +79,8 @@ class acp_search
$name = $search->get_name();
$selected = ($config['search_type'] == $type) ? ' selected="selected"' : '';
- $search_options .= '<option value="' . $type . '"' . $selected . '>' . $name . '</option>';
+ $identifier = substr($type, strrpos($type, '\\') + 1);
+ $search_options .= "<option value=\"$type\"$selected data-toggle-setting=\"#search_{$identifier}_settings\">$name</option>";
if (method_exists($search, 'acp'))
{
@@ -88,9 +89,10 @@ class acp_search
if (!$submit)
{
$template->assign_block_vars('backend', array(
- 'NAME' => $name,
- 'SETTINGS' => $vars['tpl'])
- );
+ 'NAME' => $name,
+ 'SETTINGS' => $vars['tpl'],
+ 'IDENTIFIER' => $identifier,
+ ));
}
else if (is_array($vars['config']))
{
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 3f9d21f56c..7b277da9f9 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -146,6 +146,7 @@ class acp_styles
{
global $db, $cache, $auth;
+ $this->config->increment('assets_version', 1);
$this->cache->purge();
// Clear permissions
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 66d2e4bd81..77cb499533 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -24,7 +24,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
-define('PHPBB_VERSION', '3.1.0-b3-dev');
+define('PHPBB_VERSION', '3.1.0-b4-dev');
// QA-related
// define('PHPBB_QA', 1);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 786003a9ff..d613c87728 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2356,6 +2356,10 @@ function build_url($strip_vars = false)
{
$redirect = $phpbb_path_helper->strip_url_params($redirect, $strip_vars, false);
}
+ else
+ {
+ $redirect = str_replace('&', '&amp;', $redirect);
+ }
return $redirect . ((strpos($redirect, '?') === false) ? '?' : '');
}
@@ -4859,7 +4863,6 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
// The following assigns all _common_ variables that may be used at any point in a template.
$template->assign_vars(array(
- 'CURRENT_USER_AVATAR' => phpbb_get_user_avatar($user->data),
'SITENAME' => $config['sitename'],
'SITE_DESCRIPTION' => $config['site_desc'],
'PAGE_TITLE' => $page_title,
@@ -4870,8 +4873,10 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'TOTAL_USERS_ONLINE' => $l_online_users,
'LOGGED_IN_USER_LIST' => $online_userlist,
'RECORD_USERS' => $l_online_record,
- 'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0,
+ 'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0,
+ 'CURRENT_USER_AVATAR' => phpbb_get_user_avatar($user->data),
+ 'CURRENT_USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']),
'UNREAD_NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '',
'NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '',
'U_VIEW_ALL_NOTIFICATIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_notifications'),
@@ -4888,7 +4893,6 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'SESSION_ID' => $user->session_id,
'ROOT_PATH' => $web_path,
'BOARD_URL' => $board_url,
- 'USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']),
'L_LOGIN_LOGOUT' => $l_login_logout,
'L_INDEX' => ($config['board_index_text'] !== '') ? $config['board_index_text'] : $user->lang['FORUM_INDEX'],
@@ -4970,7 +4974,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/",
'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'],
'T_STYLESHEET_LANG_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'],
- 'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.js?assets_version=" . $config['assets_version'],
+ 'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery.min.js?assets_version=" . $config['assets_version'],
'S_ALLOW_CDN' => !empty($config['allow_cdn']),
'T_THEME_NAME' => rawurlencode($user->style['style_path']),
@@ -5091,7 +5095,7 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
// Call cron-type script
$call_cron = false;
- if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'])
+ if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'] && !$cache->get('cron.lock_check'))
{
$call_cron = true;
$time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();
@@ -5112,7 +5116,8 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
// Call cron job?
if ($call_cron)
{
- global $cron;
+ global $phpbb_container;
+ $cron = $phpbb_container->get('cron.manager');
$task = $cron->find_one_ready_task();
if ($task)
@@ -5120,6 +5125,10 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
$url = $task->get_url();
$template->assign_var('RUN_CRON_TASK', '<img src="' . $url . '" width="1" height="1" alt="cron" />');
}
+ else
+ {
+ $cache->put('cron.lock_check', true, 300);
+ }
}
if ($display_template)
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
index 2c66f6009c..9a82ef7ea7 100644
--- a/phpBB/includes/functions_acp.php
+++ b/phpBB/includes/functions_acp.php
@@ -176,7 +176,7 @@ function adm_page_footer($copyright_html = true)
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
'S_COPYRIGHT_HTML' => $copyright_html,
'CREDIT_LINE' => $user->lang('POWERED_BY', '<a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Group'),
- 'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$phpbb_root_path}assets/javascript/jquery.js",
+ 'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$phpbb_root_path}assets/javascript/jquery.min.js",
'S_ALLOW_CDN' => !empty($config['allow_cdn']),
'VERSION' => $config['version'])
);
@@ -364,8 +364,9 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
if ($tpl_type[0] == 'select')
{
$size = (isset($tpl_type[1])) ? (int) $tpl_type[1] : 1;
+ $data_toggle = (!empty($tpl_type[2])) ? ' data-togglable-settings="true"' : '';
- $tpl = '<select id="' . $key . '" name="' . $name . '"' . (($size > 1) ? ' size="' . $size . '"' : '') . '>' . $return . '</select>';
+ $tpl = '<select id="' . $key . '" name="' . $name . '"' . (($size > 1) ? ' size="' . $size . '"' : '') . $data_toggle . '>' . $return . '</select>';
}
else
{
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index d56f02dd09..01d540620a 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -1348,7 +1348,8 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
// Return colour
if ($mode == 'colour')
{
- return $username_colour;
+ $username_string = $username_colour;
+ break;
}
// no break;
@@ -1368,7 +1369,8 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
// Return username
if ($mode == 'username')
{
- return $username;
+ $username_string = $username;
+ break;
}
// no break;
@@ -1389,19 +1391,23 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
// Return profile
if ($mode == 'profile')
{
- return $profile_url;
+ $username_string = $profile_url;
+ break;
}
// no break;
}
-
- if (($mode == 'full' && !$profile_url) || $mode == 'no_profile')
- {
- $username_string = str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);
- }
- else
+
+ if (!isset($username_string))
{
- $username_string = str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
+ if (($mode == 'full' && !$profile_url) || $mode == 'no_profile')
+ {
+ $username_string = str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);
+ }
+ else
+ {
+ $username_string = str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
+ }
}
/**
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 547ea69e81..cc46799252 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
function generate_smilies($mode, $forum_id)
{
global $db, $user, $config, $template, $phpbb_dispatcher;
- global $phpEx, $phpbb_root_path, $phpbb_container;
+ global $phpEx, $phpbb_root_path, $phpbb_container, $phpbb_path_helper;
$base_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id);
$pagination = $phpbb_container->get('pagination');
@@ -111,7 +111,7 @@ function generate_smilies($mode, $forum_id)
if (sizeof($smilies))
{
- $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
+ $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_path_helper->get_web_root_path();
foreach ($smilies as $row)
{
diff --git a/phpBB/includes/functions_url_matcher.php b/phpBB/includes/functions_url_matcher.php
index 8e5ae20f93..cdbe60595c 100644
--- a/phpBB/includes/functions_url_matcher.php
+++ b/phpBB/includes/functions_url_matcher.php
@@ -22,22 +22,22 @@ if (!defined('IN_PHPBB'))
/**
* Create a new UrlMatcher class and dump it into the cache file
*
-* @param \phpbb\extension\finder $finder Extension finder
+* @param \phpbb\extension\manager $manager Extension manager
* @param RequestContext $context Symfony RequestContext object
* @param string $root_path Root path
* @param string $php_ext PHP extension
* @return null
*/
-function phpbb_get_url_matcher(\phpbb\extension\finder $finder, RequestContext $context, $root_path, $php_ext)
+function phpbb_get_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path, $php_ext)
{
if (defined('DEBUG'))
{
- return phpbb_create_url_matcher($finder, $context, $root_path);
+ return phpbb_create_url_matcher($manager, $context, $root_path);
}
if (!phpbb_url_matcher_dumped($root_path, $php_ext))
{
- phpbb_create_dumped_url_matcher($finder, $root_path, $php_ext);
+ phpbb_create_dumped_url_matcher($manager, $root_path, $php_ext);
}
return phpbb_load_url_matcher($context, $root_path, $php_ext);
@@ -46,14 +46,15 @@ function phpbb_get_url_matcher(\phpbb\extension\finder $finder, RequestContext $
/**
* Create a new UrlMatcher class and dump it into the cache file
*
-* @param \phpbb\extension\finder $finder Extension finder
+* @param \phpbb\extension\manager $manager Extension manager
* @param string $root_path Root path
* @param string $php_ext PHP extension
* @return null
*/
-function phpbb_create_dumped_url_matcher(\phpbb\extension\finder $finder, $root_path, $php_ext)
+function phpbb_create_dumped_url_matcher(\phpbb\extension\manager $manager, $root_path, $php_ext)
{
- $provider = new \phpbb\controller\provider($finder);
+ $provider = new \phpbb\controller\provider();
+ $provider->find_routing_files($manager->get_finder());
$routes = $provider->find($root_path)->get_routes();
$dumper = new PhpMatcherDumper($routes);
$cached_url_matcher_dump = $dumper->dump(array(
@@ -66,13 +67,14 @@ function phpbb_create_dumped_url_matcher(\phpbb\extension\finder $finder, $root_
/**
* Create a non-cached UrlMatcher
*
-* @param \phpbb\extension\finder $finder Extension finder
+* @param \phpbb\extension\manager $manager Extension manager
* @param RequestContext $context Symfony RequestContext object
* @return UrlMatcher
*/
-function phpbb_create_url_matcher(\phpbb\extension\finder $finder, RequestContext $context, $root_path)
+function phpbb_create_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path)
{
- $provider = new \phpbb\controller\provider($finder);
+ $provider = new \phpbb\controller\provider();
+ $provider->find_routing_files($manager->get_finder());
$routes = $provider->find($root_path)->get_routes();
return new UrlMatcher($routes, $context);
}
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 5681b83212..e73ef2b78f 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -143,6 +143,13 @@ class mcp_reports
}
$post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false;
+ $message = generate_text_for_display(
+ $report['reported_post_text'],
+ $report['reported_post_uid'],
+ $report['reported_post_bitfield'],
+ $parse_post_flags,
+ false
+ );
$report['report_text'] = make_clickable(bbcode_nl2br($report['report_text']));
@@ -152,6 +159,7 @@ class mcp_reports
FROM ' . ATTACHMENTS_TABLE . '
WHERE post_msg_id = ' . $post_id . '
AND in_message = 0
+ AND filetime <= ' . (int) $report['report_time'] . '
ORDER BY filetime DESC';
$result = $db->sql_query($sql);
@@ -164,7 +172,7 @@ class mcp_reports
if (sizeof($attachments))
{
$update_count = array();
- parse_attachments($post_info['forum_id'], $report['reported_post_text'], $attachments, $update_count);
+ parse_attachments($post_info['forum_id'], $message, $attachments, $update_count);
}
// Display not already displayed Attachments for this post, we already parsed them. ;)
@@ -224,7 +232,7 @@ class mcp_reports
'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']),
'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']),
- 'POST_PREVIEW' => generate_text_for_display($report['reported_post_text'], $report['reported_post_uid'], $report['reported_post_bitfield'], $parse_post_flags, false),
+ 'POST_PREVIEW' => $message,
'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'],
'POST_DATE' => $user->format_date($post_info['post_time']),
'POST_IP' => $post_info['poster_ip'],
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 17a350bab3..8bf50b0ca3 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -776,8 +776,16 @@ class bbcode_firstpass extends bbcode
// the buffer holds a valid opening tag
if ($config['max_quote_depth'] && sizeof($close_tags) >= $config['max_quote_depth'])
{
- // there are too many nested quotes
- $error_ary['quote_depth'] = $user->lang('QUOTE_DEPTH_EXCEEDED', (int) $config['max_quote_depth']);
+ if ($config['max_quote_depth'] == 1)
+ {
+ // Depth 1 - no nesting is allowed
+ $error_ary['quote_depth'] = $user->lang('QUOTE_NO_NESTING');
+ }
+ else
+ {
+ // There are too many nested quotes
+ $error_ary['quote_depth'] = $user->lang('QUOTE_DEPTH_EXCEEDED', (int) $config['max_quote_depth']);
+ }
$out .= $buffer . $tok;
$tok = '[]';
@@ -1128,7 +1136,7 @@ class parse_message extends bbcode_firstpass
// Maximum message length check. 0 disables this check completely.
if ((int) $config['max_' . $mode . '_chars'] > 0 && $message_length > (int) $config['max_' . $mode . '_chars'])
{
- $this->warn_msg[] = $user->lang('TOO_MANY_CHARS_' . strtoupper($mode), $message_length, (int) $config['max_' . $mode . '_chars']);
+ $this->warn_msg[] = $user->lang('CHARS_' . strtoupper($mode) . '_CONTAINS', $message_length) . '<br />' . $user->lang('TOO_MANY_CHARS_LIMIT', (int) $config['max_' . $mode . '_chars']);
return (!$update_this_message) ? $return_message : $this->warn_msg;
}
@@ -1137,7 +1145,7 @@ class parse_message extends bbcode_firstpass
{
if (!$message_length || $message_length < (int) $config['min_post_chars'])
{
- $this->warn_msg[] = (!$message_length) ? $user->lang['TOO_FEW_CHARS'] : $user->lang('TOO_FEW_CHARS_LIMIT', $message_length, (int) $config['min_post_chars']);
+ $this->warn_msg[] = (!$message_length) ? $user->lang['TOO_FEW_CHARS'] : ($user->lang('CHARS_POST_CONTAINS', $message_length) . '<br />' . $user->lang('TOO_FEW_CHARS_LIMIT', (int) $config['min_post_chars']));
return (!$update_this_message) ? $return_message : $this->warn_msg;
}
}
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 3219771c93..3a3343f199 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -492,7 +492,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
if ($message_attachment && !$submit && !$refresh && !$preview && $action == 'edit')
{
// Do not change to SELECT *
- $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename
+ $sql = 'SELECT attach_id, is_orphan, attach_comment, real_filename, filesize
FROM ' . ATTACHMENTS_TABLE . "
WHERE post_msg_id = $msg_id
AND in_message = 1
@@ -1226,6 +1226,8 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
// Check for disallowed recipients
if (!empty($address_list['u']))
{
+ $can_ignore_allow_pm = $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_');
+
// Administrator deactivated users check and we need to check their
// PM status (do they want to receive PM's?)
// Only check PM status if not a moderator or admin, since they
@@ -1233,14 +1235,11 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
$sql = 'SELECT user_id, user_allow_pm
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', array_keys($address_list['u'])) . '
- AND (user_type = ' . USER_INACTIVE . '
- AND user_inactive_reason = ' . INACTIVE_MANUAL . ')';
-
- $can_ignore_allow_pm = ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'));
- if (!$can_ignore_allow_pm)
- {
- $sql .= ' OR user_allow_pm = 0';
- }
+ AND (
+ (user_type = ' . USER_INACTIVE . '
+ AND user_inactive_reason = ' . INACTIVE_MANUAL . ')
+ ' . ($can_ignore_allow_pm ? '' : ' OR user_allow_pm = 0') . '
+ )';
$result = $db->sql_query($sql);