From 613582e2c5bda7b9fc4b75598d7696ff8f4a681e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 9 Nov 2023 21:08:31 +0100 Subject: [PATCH] [ticket/17212] Support updating session info when editing post with p= PHPBB3-17212 --- phpBB/phpbb/session.php | 2 +- phpBB/posting.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index df88a849df..43f96c90af 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -1759,7 +1759,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 && (!isset($this->data['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'] || $this->data['session_forum_id'] != $this->page['forum']) && !$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) diff --git a/phpBB/posting.php b/phpBB/posting.php index 736812cfaf..e188da8ffb 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -104,8 +104,16 @@ switch ($mode) trigger_error('NO_POST'); } + if (!$forum_id) + { + $user->page['forum'] = (int) $topic_forum['forum_id']; + $user->update_session_page = true; + $user->update_session_infos(); + } + $topic_id = (int) $topic_forum['topic_id']; $forum_id = (int) $topic_forum['forum_id']; + break; }