From 04e8aed0fa4021bd7bc9174b48d9f274f2fa4c38 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Wed, 17 Aug 2011 03:20:07 +0000 Subject: [PATCH] Fix (again) the logic to test if the hosting domain is a FreeBSD.org domain and not a mirror by adding some regex to the javascript. --- en/layout/js/google.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/en/layout/js/google.js b/en/layout/js/google.js index 0a0263c78b..619fbe518a 100644 --- a/en/layout/js/google.js +++ b/en/layout/js/google.js @@ -1,11 +1,12 @@ -/* $FreeBSD: www/en/layout/js/google.js,v 1.1 2011/08/15 00:30:17 gjb Exp $ */ +/* $FreeBSD: www/en/layout/js/google.js,v 1.2 2011/08/16 23:19:35 gjb Exp $ */ h=document.location.host; /* * Check that the hosting domain is actually a FreeBSD.org domain, so * we don't accidentally obtain data from mirrors. */ -if (h == "www.freebsd.org" || h == "freebsd.org" || h == "wiki.freebsd.org") { +fbsdregex=/m/((www|wiki)\.)?freebsd\.org\/(.*)?/i; +if (h.test(fbsdregex)) { var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-22767463-1']); _gaq.push(['_trackPageview']);