When checking HTTP_HOST to determine if we should use relative or

absolute base path, do the check case insensitive to handle if
HTTP_HOST e.g. comes in as FreeBSD.org.

Break a rather long line (being changed anyway) to improve
readability.
This commit is contained in:
Simon L. B. Nielsen 2006-07-23 22:35:12 +00:00
parent db89ca035d
commit eee4df9058
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=28366

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.31 2006/05/08 23:15:37 kuriyama Exp $
# $FreeBSD: www/en/cgi/cgi-style.pl,v 1.32 2006/07/23 18:36:53 simon Exp $
#
# Perl routines to encapsulate various elements of HTML page style.
@ -13,7 +13,9 @@ if (!defined($hsty_base)) {
# serve their local copy instead of going to the main site.
# However, if we aren't running as a cgi, or if we're
# running on cgi, hub, docs or people, use the absolute home path.
if (!defined($ENV{'HTTP_HOST'}) || $ENV{'HTTP_HOST'} =~ /(cgi|hub|docs|people).freebsd.org/) {
if (!defined($ENV{'HTTP_HOST'}) ||
$ENV{'HTTP_HOST'} =~ /(cgi|hub|docs|people).freebsd.org/i) {
$hsty_base = 'http://www.FreeBSD.org'
} else {
$hsty_base = '..';