aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_ban.php4
-rw-r--r--phpBB/includes/acp/acp_captcha.php4
-rw-r--r--phpBB/includes/acp/acp_forums.php2
-rw-r--r--phpBB/includes/acp/acp_php_info.php4
-rw-r--r--phpBB/includes/acp/acp_prune.php8
-rw-r--r--phpBB/includes/acp/acp_users.php2
-rw-r--r--phpBB/includes/acp/info/acp_board.php2
-rw-r--r--phpBB/includes/db/oracle.php5
-rw-r--r--phpBB/includes/db/postgres.php5
-rw-r--r--phpBB/includes/functions.php7
-rw-r--r--phpBB/includes/functions_convert.php3
-rw-r--r--phpBB/includes/functions_display.php7
-rw-r--r--phpBB/includes/functions_user.php10
-rw-r--r--phpBB/includes/session.php4
-rw-r--r--phpBB/includes/ucp/ucp_profile.php2
15 files changed, 46 insertions, 23 deletions
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index 3198376584..a7ea57b753 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -224,7 +224,7 @@ class acp_ban
$template->assign_block_vars('ban_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,
- 'A_REASON' => addslashes(htmlspecialchars_decode($reason)),
+ 'A_REASON' => addslashes($reason),
));
}
}
@@ -236,7 +236,7 @@ class acp_ban
$template->assign_block_vars('ban_give_reason', array(
'BAN_ID' => $ban_id,
'REASON' => $reason,
- 'A_REASON' => addslashes(htmlspecialchars_decode($reason)),
+ 'A_REASON' => addslashes($reason),
));
}
}
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index 56a57e319c..1893eed14f 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -89,14 +89,14 @@ class acp_captcha
}
else
{
- trigger_error($user->lang['CAPTCHA_UNAVAILABLE'] . adm_back_link($this->u_action));
+ trigger_error($user->lang['CAPTCHA_UNAVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
}
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
else if ($submit)
{
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link());
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link(), E_USER_WARNING);
}
else
{
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 6261f866bb..f2f1bd80e2 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -983,7 +983,7 @@ class acp_forums
if (!$row)
{
- trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&' . $this->parent_id), E_USER_WARNING);
+ trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
}
if ($row['forum_type'] == FORUM_LINK)
diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php
index 9935c0466e..0499095004 100644
--- a/phpBB/includes/acp/acp_php_info.php
+++ b/phpBB/includes/acp/acp_php_info.php
@@ -35,9 +35,9 @@ class acp_php_info
$this->tpl_name = 'acp_php_info';
$this->page_title = 'ACP_PHP_INFO';
-
+
ob_start();
- @phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES);
+ phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES);
$phpinfo = ob_get_clean();
$phpinfo = trim($phpinfo);
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index 7eeb37133f..ffe20f86f5 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -315,8 +315,8 @@ class acp_prune
'mode' => $mode,
'prune' => 1,
- 'users' => request_var('users', '', true),
- 'username' => request_var('username', '', true),
+ 'users' => utf8_normalize_nfc(request_var('users', '', true)),
+ 'username' => utf8_normalize_nfc(request_var('username', '', true)),
'email' => request_var('email', ''),
'joined_select' => request_var('joined_select', ''),
'joined' => request_var('joined', ''),
@@ -369,7 +369,7 @@ class acp_prune
{
global $user, $db;
- $users = request_var('users', '', true);
+ $users = utf8_normalize_nfc(request_var('users', '', true));
if ($users)
{
@@ -378,7 +378,7 @@ class acp_prune
}
else
{
- $username = request_var('username', '', true);
+ $username = utf8_normalize_nfc(request_var('username', '', true));
$email = request_var('email', '');
$joined_select = request_var('joined_select', 'lt');
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 7914edd056..3a405da825 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1706,7 +1706,7 @@ class acp_users
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
}
- if (avatar_process_user($error, $user_row))
+ if (avatar_process_user($error, $user_row, $can_upload))
{
trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_row['user_id']));
}
diff --git a/phpBB/includes/acp/info/acp_board.php b/phpBB/includes/acp/info/acp_board.php
index 58b650650c..3e18f55940 100644
--- a/phpBB/includes/acp/info/acp_board.php
+++ b/phpBB/includes/acp/info/acp_board.php
@@ -24,7 +24,7 @@ class acp_board_info
'features' => array('title' => 'ACP_BOARD_FEATURES', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'avatar' => array('title' => 'ACP_AVATAR_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'message' => array('title' => 'ACP_MESSAGE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_MESSAGES')),
- 'post' => array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
+ 'post' => array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_MESSAGES')),
'signature' => array('title' => 'ACP_SIGNATURE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'feed' => array('title' => 'ACP_FEED_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'registration' => array('title' => 'ACP_REGISTER_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php
index 55b3599800..5a9b18abf0 100644
--- a/phpBB/includes/db/oracle.php
+++ b/phpBB/includes/db/oracle.php
@@ -261,6 +261,10 @@ class dbal_oracle extends dbal
{
$cols = explode(', ', $regs[2]);
+/* The code inside this comment block breaks clob handling, but does allow the
+ database restore script to work. If you want to allow no posts longer than 4KB
+ and/or need the db restore script, uncomment this.
+
preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER);
if (sizeof($cols) !== sizeof($vals))
@@ -310,6 +314,7 @@ class dbal_oracle extends dbal
$vals = array(0 => $vals);
}
+*/
$inserts = $vals[0];
unset($vals);
diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php
index b3139b3d79..2a885f1d04 100644
--- a/phpBB/includes/db/postgres.php
+++ b/phpBB/includes/db/postgres.php
@@ -46,7 +46,10 @@ class dbal_postgres extends dbal
if ($sqlserver)
{
- if (strpos($sqlserver, ':') !== false)
+ // $sqlserver can carry a port separated by : for compatibility reasons
+ // If $sqlserver has more than one : it's probably an IPv6 address.
+ // In this case we only allow passing a port via the $port variable.
+ if (substr_count($sqlserver, ':') === 1)
{
list($sqlserver, $port) = explode(':', $sqlserver);
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 3e80f93114..3f097f171f 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1660,10 +1660,11 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
* @param string $sql_extra Extra WHERE SQL statement
* @param string $sql_sort ORDER BY SQL sorting statement
* @param string $sql_limit Limits the size of unread topics list, 0 for unlimited query
+* @param string $sql_limit_offset Sets the offset of the first row to search, 0 to search from the start
*
* @return array[int][int] Topic ids as keys, mark_time of topic as value
*/
-function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001)
+function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0)
{
global $config, $db, $user;
@@ -1709,7 +1710,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
);
$sql = $db->sql_build_query('SELECT', $sql_array);
- $result = $db->sql_query_limit($sql, $sql_limit);
+ $result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset);
while ($row = $db->sql_fetchrow($result))
{
@@ -1742,7 +1743,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
WHERE t.topic_last_post_time > ' . $user_lastmark . "
$sql_extra
$sql_sort";
- $result = $db->sql_query_limit($sql, $sql_limit);
+ $result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset);
while ($row = $db->sql_fetchrow($result))
{
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 0fdae9b274..c035fd3739 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -1025,6 +1025,9 @@ function set_user_options()
'bbcode' => array('bit' => 8, 'default' => 1),
'smilies' => array('bit' => 9, 'default' => 1),
'popuppm' => array('bit' => 10, 'default' => 0),
+ 'sig_bbcode' => array('bit' => 15, 'default' => 1),
+ 'sig_smilies' => array('bit' => 16, 'default' => 1),
+ 'sig_links' => array('bit' => 17, 'default' => 1),
);
$option_field = 0;
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index ec348138f5..5e6239b070 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -969,11 +969,16 @@ function display_user_activity(&$userdata)
$forum_ary = array_unique($forum_ary);
$forum_sql = (sizeof($forum_ary)) ? 'AND ' . $db->sql_in_set('forum_id', $forum_ary, true) : '';
+ $fid_m_approve = $auth->acl_getf('m_approve', true);
+ $sql_m_approve = (!empty($fid_m_approve)) ? 'OR ' . $db->sql_in_set('forum_id', array_keys($fid_m_approve)) : '';
+
// Obtain active forum
$sql = 'SELECT forum_id, COUNT(post_id) AS num_posts
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $userdata['user_id'] . "
AND post_postcount = 1
+ AND (post_approved = 1
+ $sql_m_approve)
$forum_sql
GROUP BY forum_id
ORDER BY num_posts DESC";
@@ -996,6 +1001,8 @@ function display_user_activity(&$userdata)
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $userdata['user_id'] . "
AND post_postcount = 1
+ AND (post_approved = 1
+ $sql_m_approve)
$forum_sql
GROUP BY topic_id
ORDER BY num_posts DESC";
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 21e82030ee..bb99314ced 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -297,6 +297,7 @@ function user_add($user_row, $cp_data = false)
if ($config['new_member_group_default'])
{
group_user_add($add_group_id, $user_id, false, false, true);
+ $user_row['group_id'] = $add_group_id;
}
else
{
@@ -527,7 +528,7 @@ function user_delete($mode, $user_id, $post_username = false)
$db->sql_transaction('begin');
- $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE);
+ $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE, PRIVMSGS_FOLDER_TABLE, PRIVMSGS_RULES_TABLE);
foreach ($table_ary as $table)
{
@@ -2283,7 +2284,7 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $
/**
* Uploading/Changing user avatar
*/
-function avatar_process_user(&$error, $custom_userdata = false)
+function avatar_process_user(&$error, $custom_userdata = false, $can_upload = null)
{
global $config, $phpbb_root_path, $auth, $user, $db;
@@ -2322,7 +2323,10 @@ function avatar_process_user(&$error, $custom_userdata = false)
$avatar_select = basename(request_var('avatar_select', ''));
// Can we upload?
- $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ if (is_null($can_upload))
+ {
+ $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
+ }
if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload)
{
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 0a01b4e73b..e157053e61 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -2134,9 +2134,9 @@ class user extends session
// Zone offset
$zone_offset = $this->timezone + $this->dst;
- // Show date <= 1 hour ago as 'xx min ago'
+ // Show date <= 1 hour ago as 'xx min ago' but not greater than 60 seconds in the future
// A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago'
- if ($delta <= 3600 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
+ if ($delta <= 3600 && $delta > -60 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
{
return $this->lang(array('datetime', 'AGO'), max(0, (int) floor($delta / 60)));
}
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index f4f4abad4a..363a4803b6 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -572,7 +572,7 @@ class ucp_profile
{
if (check_form_key('ucp_avatar'))
{
- if (avatar_process_user($error))
+ if (avatar_process_user($error, false, $can_upload))
{
meta_refresh(3, $this->u_action);
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');