aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php35
1 files changed, 15 insertions, 20 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 21776693b0..1de70d4210 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1636,7 +1636,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
if (empty($sql_sort))
{
- $sql_sort = 'ORDER BY t.topic_last_post_time DESC';
+ $sql_sort = 'ORDER BY t.topic_last_post_time DESC, t.topic_last_post_id DESC';
}
if ($config['load_db_lastread'] && $user->data['is_registered'])
@@ -2576,15 +2576,17 @@ function add_form_key($form_name)
}
/**
-* Check the form key. Required for all altering actions not secured by confirm_box
-* @param string $form_name The name of the form; has to match the name used in add_form_key, otherwise no restrictions apply
-* @param int $timespan The maximum acceptable age for a submitted form in seconds. Defaults to the config setting.
-* @param string $return_page The address for the return link
-* @param bool $trigger If true, the function will triger an error when encountering an invalid form
-*/
-function check_form_key($form_name, $timespan = false, $return_page = '', $trigger = false)
+ * Check the form key. Required for all altering actions not secured by confirm_box
+ *
+ * @param string $form_name The name of the form; has to match the name used
+ * in add_form_key, otherwise no restrictions apply
+ * @param int $timespan The maximum acceptable age for a submitted form
+ * in seconds. Defaults to the config setting.
+ * @return bool True, if the form key was valid, false otherwise
+ */
+function check_form_key($form_name, $timespan = false)
{
- global $config, $user;
+ global $config, $request, $user;
if ($timespan === false)
{
@@ -2592,10 +2594,10 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
$timespan = ($config['form_token_lifetime'] == -1) ? -1 : max(30, $config['form_token_lifetime']);
}
- if (isset($_POST['creation_time']) && isset($_POST['form_token']))
+ if ($request->is_set_post('creation_time') && $request->is_set_post('form_token'))
{
- $creation_time = abs(request_var('creation_time', 0));
- $token = request_var('form_token', '');
+ $creation_time = abs($request->variable('creation_time', 0));
+ $token = $request->variable('form_token', '');
$diff = time() - $creation_time;
@@ -2612,11 +2614,6 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
}
}
- if ($trigger)
- {
- trigger_error($user->lang['FORM_INVALID'] . $return_page);
- }
-
return false;
}
@@ -2832,8 +2829,6 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
if ($result['status'] == LOGIN_SUCCESS)
{
$redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx");
- $message = ($l_success) ? $l_success : $user->lang['LOGIN_REDIRECT'];
- $l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "{$phpbb_root_path}index.$phpEx" || $redirect === "index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']);
// append/replace SID (may change during the session for AOL users)
$redirect = reapply_sid($redirect);
@@ -4664,7 +4659,7 @@ function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config
/**
* Get avatar
*
-* @param array $row Row cleaned by \phpbb\avatar\driver\driver::clean_row
+* @param array $row Row cleaned by \phpbb\avatar\manager::clean_row
* @param string $alt Optional language string for alt tag within image, can be a language key or text
* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
*