aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_permissions.php5
-rw-r--r--phpBB/includes/acp/acp_users.php2
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/includes/functions_content.php12
-rw-r--r--phpBB/includes/functions_download.php14
-rw-r--r--phpBB/includes/functions_messenger.php12
-rw-r--r--phpBB/includes/functions_posting.php9
-rw-r--r--phpBB/includes/functions_privmsgs.php9
-rw-r--r--phpBB/includes/functions_user.php2
9 files changed, 61 insertions, 6 deletions
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 660afb4e93..62e75a2db7 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -755,6 +755,7 @@ class acp_permissions
$this->log_action($mode, 'add', $permission_type, $ug_type, $ug_id, $forum_id);
+ meta_refresh(5, $this->u_action);
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
}
@@ -825,10 +826,12 @@ class acp_permissions
if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local')
{
+ meta_refresh(5, $this->u_action . '&forum_id[]=' . implode('&forum_id[]=', $forum_ids));
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&forum_id[]=' . implode('&forum_id[]=', $forum_ids)));
}
else
{
+ meta_refresh(5, $this->u_action);
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
}
}
@@ -899,10 +902,12 @@ class acp_permissions
if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local')
{
+ meta_refresh(5, $this->u_action . '&forum_id[]=' . implode('&forum_id[]=', $forum_id));
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&forum_id[]=' . implode('&forum_id[]=', $forum_id)));
}
else
{
+ meta_refresh(5, $this->u_action);
trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
}
}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 008cc02471..cd44800af8 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1929,7 +1929,7 @@ class acp_users
'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"',
- 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),
+ 'L_AVATAR_EXPLAIN' => $user->lang(($config['avatar_filesize'] == 0) ? 'AVATAR_EXPLAIN_NO_FILESIZE' : 'AVATAR_EXPLAIN', $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),
'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),
));
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index a152d9b620..ba448f3125 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2776,7 +2776,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&') . 'confirm_key=' . $confirm_key;
$template->assign_vars(array(
- 'MESSAGE_TITLE' => (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title],
+ 'MESSAGE_TITLE' => (!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang($title, 1),
'MESSAGE_TEXT' => (!isset($user->lang[$title . '_CONFIRM'])) ? $title : $user->lang[$title . '_CONFIRM'],
'YES_VALUE' => $user->lang['YES'],
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 8e60804d6e..8858d1a307 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -980,7 +980,7 @@ function bbcode_nl2br($text)
*/
function smiley_text($text, $force_option = false)
{
- global $config, $user, $phpbb_path_helper;
+ global $config, $user, $phpbb_path_helper, $phpbb_dispatcher;
if ($force_option || !$config['allow_smilies'] || !$user->optionget('viewsmilies'))
{
@@ -989,6 +989,16 @@ function smiley_text($text, $force_option = false)
else
{
$root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_path_helper->get_web_root_path();
+
+ /**
+ * Event to override the root_path for smilies
+ *
+ * @event core.smiley_text_root_path
+ * @var string root_path root_path for smilies
+ * @since 3.1.11-RC1
+ */
+ $vars = array('root_path');
+ extract($phpbb_dispatcher->trigger_event('core.smiley_text_root_path', compact($vars)));
return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img class="smilies" src="' . $root_path . $config['smilies_path'] . '/\2 />', $text);
}
}
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index c571de579e..86c60c31ff 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -677,6 +677,8 @@ function phpbb_download_handle_forum_auth($db, $auth, $topic_id)
*/
function phpbb_download_handle_pm_auth($db, $auth, $user_id, $msg_id)
{
+ global $phpbb_dispatcher;
+
if (!$auth->acl_get('u_pm_download'))
{
send_status_line(403, 'Forbidden');
@@ -685,6 +687,18 @@ function phpbb_download_handle_pm_auth($db, $auth, $user_id, $msg_id)
$allowed = phpbb_download_check_pm_auth($db, $user_id, $msg_id);
+ /**
+ * Event to modify PM attachments download auth
+ *
+ * @event core.modify_pm_attach_download_auth
+ * @var bool allowed Whether the user is allowed to download from that PM or not
+ * @var int msg_id The id of the PM to download from
+ * @var int user_id The user id for auth check
+ * @since 3.1.11-RC1
+ */
+ $vars = array('allowed', 'msg_id', 'user_id');
+ extract($phpbb_dispatcher->trigger_event('core.modify_pm_attach_download_auth', compact($vars)));
+
if (!$allowed)
{
send_status_line(403, 'Forbidden');
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 9b3ca14101..f141637fb9 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -438,7 +438,7 @@ class messenger
*/
function build_header($to, $cc, $bcc)
{
- global $config;
+ global $config, $phpbb_dispatcher;
// We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility
$headers = array();
@@ -470,6 +470,16 @@ class messenger
$headers[] = 'X-MimeOLE: phpBB3';
$headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());
+ /**
+ * Event to modify email header entries
+ *
+ * @event core.modify_email_headers
+ * @var array headers Array containing email header entries
+ * @since 3.1.11-RC1
+ */
+ $vars = array('headers');
+ extract($phpbb_dispatcher->trigger_event('core.modify_email_headers', compact($vars)));
+
if (sizeof($this->extra_headers))
{
$headers = array_merge($headers, $this->extra_headers);
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 4a4d2de0fe..30f5ba91ef 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -119,6 +119,15 @@ function generate_smilies($mode, $forum_id)
foreach ($smilies as $row)
{
+ /**
+ * Modify smiley root path before populating smiley list
+ *
+ * @event core.generate_smilies_before
+ * @var string root_path root_path for smilies
+ * @since 3.1.11-RC1
+ */
+ $vars = array('root_path');
+ extract($phpbb_dispatcher->trigger_event('core.generate_smilies_before', compact($vars)));
$template->assign_block_vars('smiley', array(
'SMILEY_CODE' => $row['code'],
'A_SMILEY_CODE' => addslashes($row['code']),
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 1639eb1a4c..4aad1746d5 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -889,9 +889,16 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
SET pm_unread = 0
WHERE msg_id = $msg_id
AND user_id = $user_id
- AND folder_id = $folder_id";
+ AND folder_id = $folder_id
+ AND pm_unread = 1";
$db->sql_query($sql);
+ // If the message is already marked as read, we just skip the rest to avoid negative PM count
+ if (!$db->sql_affectedrows())
+ {
+ return;
+ }
+
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_unread_privmsg = user_unread_privmsg - 1
WHERE user_id = $user_id";
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index b82abe0c5e..0b39339c7f 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -2279,7 +2279,7 @@ function phpbb_avatar_explanation_string()
{
global $config, $user;
- return $user->lang('AVATAR_EXPLAIN',
+ return $user->lang(($config['avatar_filesize'] == 0) ? 'AVATAR_EXPLAIN_NO_FILESIZE' : 'AVATAR_EXPLAIN',
$user->lang('PIXELS', (int) $config['avatar_max_width']),
$user->lang('PIXELS', (int) $config['avatar_max_height']),
round($config['avatar_filesize'] / 1024));