mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-13 20:32:11 +02:00
[ticket/16706] Fix undefined array keys on user IP ban
PHPBB3-16706
This commit is contained in:
parent
0daf4b6b1c
commit
c499025623
@ -4049,7 +4049,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||
'S_ENABLE_FEEDS_TOPICS_ACTIVE' => ($config['feed_topics_active']) ? true : false,
|
||||
'S_ENABLE_FEEDS_NEWS' => ($s_feed_news) ? true : false,
|
||||
|
||||
'S_LOAD_UNREADS' => ($config['load_unreads_search'] && ($config['load_anon_lastread'] || $user->data['is_registered'])) ? true : false,
|
||||
'S_LOAD_UNREADS' => (bool) $config['load_unreads_search'] && ($config['load_anon_lastread'] || !empty($user->data['is_registered'])),
|
||||
|
||||
'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),
|
||||
|
||||
|
@ -181,10 +181,10 @@ class token_storage implements TokenStorageInterface
|
||||
{
|
||||
$this->cachedToken = null;
|
||||
|
||||
$sql = 'DELETE FROM ' . $this->oauth_token_table . '
|
||||
$sql = 'DELETE FROM ' . $this->oauth_token_table . '
|
||||
WHERE user_id = ' . (int) $this->user->data['user_id'];
|
||||
|
||||
if ((int) $this->user->data['user_id'] === ANONYMOUS)
|
||||
if ((int) $this->user->data['user_id'] === ANONYMOUS && isset($this->user->data['session_id']))
|
||||
{
|
||||
$sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
|
||||
}
|
||||
@ -504,7 +504,7 @@ class token_storage implements TokenStorageInterface
|
||||
*/
|
||||
protected function get_access_token_row($data)
|
||||
{
|
||||
$sql = 'SELECT oauth_token
|
||||
$sql = 'SELECT oauth_token
|
||||
FROM ' . $this->oauth_token_table . '
|
||||
WHERE ' . $this->db->sql_build_array('SELECT', $data);
|
||||
$result = $this->db->sql_query($sql);
|
||||
@ -523,7 +523,7 @@ class token_storage implements TokenStorageInterface
|
||||
*/
|
||||
protected function get_state_row($data)
|
||||
{
|
||||
$sql = 'SELECT oauth_state
|
||||
$sql = 'SELECT oauth_state
|
||||
FROM ' . $this->oauth_state_table . '
|
||||
WHERE ' . $this->db->sql_build_array('SELECT', $data);
|
||||
$result = $this->db->sql_query($sql);
|
||||
|
@ -1660,7 +1660,7 @@ class session
|
||||
}
|
||||
|
||||
// Do not update the session page for ajax requests, so the view online still works as intended
|
||||
$page_changed = $this->update_session_page && $this->data['session_page'] != $this->page['page'] && !$request->is_ajax();
|
||||
$page_changed = $this->update_session_page && (!isset($this->data['session_page']) || $this->data['session_page'] != $this->page['page']) && !$request->is_ajax();
|
||||
|
||||
// Only update session DB a minute or so after last update or if page changes
|
||||
if ($this->time_now - (isset($this->data['session_time']) ? $this->data['session_time'] : 0) > 60 || $page_changed)
|
||||
|
Loading…
x
Reference in New Issue
Block a user