Empty Referrer String Should Produce Blank Output

Created on 16 July 2011, over 13 years ago
Updated 31 May 2024, 6 months ago

I've been annoyed (for a while) that when you look at the Track tab on a node (say: node/10/track) if there are no referrers the page would display a long list of node/10/track as referrers.

I've tracked it down to function statistics_node_tracker() & the use of _statistics_link(). If we check to see if the $log->url is empty as I've done here:

    foreach ($result as $log) {
      $rows[] = array(
        array('data' => format_date($log->timestamp, 'short'), 'class' => array('nowrap')),
        (!empty($log->url)) ? _statistics_link($log->url) : '',
        theme('username', array('account' => $log)),
        l(t('details'), "admin/reports/access/$log->aid"),
      );
    }

The problem goes away and you just get a list of valid Referrer URLs.

I can do up a patch against D8 but wanted to run this by folks first. Seems like a simple fix.

πŸ› Bug report
Status

Needs work

Version

7.0 ⚰️

Component
StatisticsΒ  β†’

Last updated about 23 hours ago

No maintainer
Created by

πŸ‡¨πŸ‡¦Canada mgifford Ottawa, Ontario

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024