Ensure the Google Analytics code only runs when served from FreeBSD.org

or google.com servers.  This was always the intention, but due to a bug
it would also run when (for example) accessed via
http://www.freebsd.org.nyud.net.

Approved by:	webstats (eadler)
This commit is contained in:
Gavin Atkinson 2014-10-14 23:32:42 +00:00
parent c6ce6f0c13
commit 4e718926f2
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=45832

View file

@ -11,12 +11,12 @@
var enable_ga = true;
var allow_track = true;
var h = document.location.host;
var h = document.location.hostname;
/*
* Check that the hosting domain is actually a FreeBSD.org domain, so
* we don't accidentally obtain data from mirrors.
*/
var fbsdregex = /((docs|security|svnweb|wiki|www)\.freebsd\.org|google\.com)/i;
var fbsdregex = /((docs|security|svnweb|wiki|www)\.freebsd\.org|google\.com)$/i;
if (typeof navigator.doNotTrack !== "undefined" && (navigator.doNotTrack == "yes" || navigator.doNotTrack == "1")) {
allow_track = false;