- From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 21 Sep 2009 19:07:25 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/validator/httpd/cgi-bin In directory hutz:/tmp/cvs-serv899 Modified Files: check Log Message: Code cleanups. Index: check =================================================================== RCS file: /sources/public/validator/httpd/cgi-bin/check,v retrieving revision 1.697 retrieving revision 1.698 diff -u -d -r1.697 -r1.698 --- check 21 Sep 2009 19:00:05 -0000 1.697 +++ check 21 Sep 2009 19:07:23 -0000 1.698 @@ -514,9 +514,7 @@ } elsif (&is_xml($File) and not $File->{ContentType} =~ m(^text/)) { $File->{Charset}->{Use} = 'utf-8'; # UTF-8 (image/svg+xml etc.) } -unless ($File->{Charset}->{Use}) { - $File->{Charset}->{Use} = $File->{Charset}->{META}; -} +$File->{Charset}->{Use} ||= $File->{Charset}->{META}; # # Handle any Fallback or Override for the charset. @@ -2457,27 +2455,24 @@ # apparently, with mod_perl2, $path_info is empty even if it should be filled # working around that - if (!$path_info) { - if ($File->{Env}->{'Self URI'} =~ /check\/referer$/){ - $path_info = '/referer'; - $File->{Env}->{'Self URI'} =~ s/\/referer//; - } + if (!$path_info && $File->{Env}->{'Self URI'} =~ /check\/referer$/) { + $path_info = '/referer'; + $File->{Env}->{'Self URI'} =~ s/\/referer//; } + # Futz the URL so "/referer" works. if ($path_info) { - if ($path_info eq '/referer' or $path_info eq '/referrer') { + if ($path_info =~ m|^/referr?er$|) { if ($q->referer) { $q->param('uri', $q->referer); print redirect &self_url_q($q, $File); - exit; } else { print redirect $File->{Env}->{'Self URI'} . '?uri=referer'; - exit; } } else { print redirect &self_url_q($q, $File); - exit; } + exit; } # Use "url" unless a "uri" was also given.
Received on Monday, 21 September 2009 19:07:33 UTC