Some PHP setups return $_SERVER['HTTP_HOST'] with a port designation -- e.g. http://domain.tld:80. With this patch, statistics.module removes the port designation before distinguishing between internal and external referrers. Without this patch, all referrers will be labeled as external in PHP setups where the port designation is included in HTTP_HOST.

Comments

Anonymous’s picture

I have provided a patch before which also enabled stats module to treat more domain names as local ones, since a site might be accessible via multiple domain names (like www.drupal.org and drupal.org). That was not accepted. It is not just port numbers that are problems.

killes@www.drop.org’s picture

Doesn't apply anymore-

robin monks’s picture

Assigned: njivy » robin monks
StatusFileSize
new1.73 KB

Updated patch to work with latest HEAD.

Tested to work with CVS HEAD.

I'll take over any further problems that this patch may incur.

Robin

dries’s picture

Not sure but it might be shorter/better to use PHP's parse_url()?

robin monks’s picture

StatusFileSize
new1.7 KB

Here is a patch using parse_url.

Robin

robin monks’s picture

Status: Needs review » Closed (duplicate)

A newer incarnaton of this code now rests with http://drupal.org/node/27787.

If that patch does not go though, this bug will be reopened and updated. Otherwise....duplicate.

Robin