diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 4a1418c3e1..459c9a8ffd 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -253,7 +253,7 @@ p a {
[Fix] Prevent changing postable forum having subforums to link forum without moving subforums out first
[Fix] Do not display version in admin template (Bug #13495)
[Fix] Allow manual specification of remote avatar dimensions if getimagesize is disabled (Bug #13531)
-
+ [Fix] Make viewonline use the session page's added forum parameter (Bug #13597)
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index ca461a9118..65317b228c 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -214,7 +214,7 @@ while ($row = $db->sql_fetchrow($result))
case 'posting':
case 'viewforum':
case 'viewtopic':
- preg_match('#f=([0-9]+)#', $row['session_page'], $forum_id);
+ preg_match('#_f_=([0-9]+)x#i', $row['session_page'], $forum_id);
$forum_id = (sizeof($forum_id)) ? (int) $forum_id[1] : 0;
if ($forum_id && $auth->acl_get('f_list', $forum_id))