Remove trailing "/(.*)?" from regex check - document.location.host only

returns the hostname, not trailing page information.

With input from:	simon
This commit is contained in:
Glen Barber 2011-08-17 13:58:23 +00:00
parent 7ac36b27cf
commit cba5de5c7c
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=37566

View file

@ -1,11 +1,11 @@
/* $FreeBSD: www/en/layout/js/google.js,v 1.3 2011/08/17 03:20:07 gjb Exp $ */
/* $FreeBSD: www/en/layout/js/google.js,v 1.4 2011/08/17 13:21:14 gjb Exp $ */
var h=document.location.host;
/*
* Check that the hosting domain is actually a FreeBSD.org domain, so
* we don't accidentally obtain data from mirrors.
*/
var fbsdregex=/(www|wiki)\.freebsd\.org\/(.*)?/i;
var fbsdregex=/(www|wiki)\.freebsd\.org/i;
if (fbsdregex.test(h)) {
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22767463-1']);