Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-16989

View counter increase by every page refresh

    XMLWordPrintable

Details

    Description

      After upgrading from 3.0.10 to 3.3.7 the view counter of topics and attachments increase by every page reload (F5).

      I had a look at the code and I think I found the reason.

      Line 2265 in viewtopic.php (3.3.7) checks for:

      strpos($user->data['session_page'], '&t=' . $topic_id) === false

      But a link to a forum looks like this:

      viewforum.php?t=...

      There is no forum id any more, so no & in the URL.

      When viewing a post the same happens, the counters increase by every page refresh. This happens in 3.0 and 3.3.

      viewforum.php?p=...

      Changing the check in viewtopic.php to this will stop counting on page refresh, at least in the few experiments I did so far:

      preg_match('/[\?&](t=' . $topic_id . '|p=' . $post_id . ')/', $user->data['session_page']) == 0

      Attachments

        Activity

          People

            Unassigned Unassigned
            maluki maluki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: