[ticket/16558] Improve viewonline page

Remove unsupport PHP syntax

PHPBB3-16558
This commit is contained in:
v12mike 2020-07-28 23:54:57 -04:00
parent aa3472ce76
commit 9f682ea220

View file

@ -270,14 +270,14 @@ while ($row = $db->sql_fetchrow($result))
$matches = array(); $matches = array();
$pattern = '#(viewtopic|posting)\.' . $phpEx . '((\?|&)\w+=\w+)*(\?|&)'; $pattern = '#(viewtopic|posting)\.' . $phpEx . '((\?|&)\w+=\w+)*(\?|&)';
preg_match($pattern . 'f=(\d+)#', $row['session_page'], $matches, PREG_UNMATCHED_AS_NULL); preg_match($pattern . 'f=(\d+)#', $row['session_page'], $matches);
if ($matches[$array_match_index]) if ($matches[$array_match_index])
{ {
$forum_id = (int) $matches[$array_match_index]; $forum_id = (int) $matches[$array_match_index];
} }
else else
{ {
preg_match($pattern . 't=(\d+)#', $row['session_page'], $matches, PREG_UNMATCHED_AS_NULL); preg_match($pattern . 't=(\d+)#', $row['session_page'], $matches);
if ($matches[$array_match_index]) if ($matches[$array_match_index])
{ {
$topic_id = $matches[$array_match_index]; $topic_id = $matches[$array_match_index];
@ -290,7 +290,7 @@ while ($row = $db->sql_fetchrow($result))
} }
else else
{ {
preg_match($pattern . 'p=(\d+)#', $row['session_page'], $matches, PREG_UNMATCHED_AS_NULL); preg_match($pattern . 'p=(\d+)#', $row['session_page'], $matches);
if ($matches[$array_match_index]) if ($matches[$array_match_index])
{ {
$post_id = $matches[$array_match_index]; $post_id = $matches[$array_match_index];