summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorville <ville@localhost>2007-03-12 20:38:42 +0000
committerville <ville@localhost>2007-03-12 20:38:42 +0000
commitc9ccbc99090ea0a836be108932cdd4404e052dd9 (patch)
tree104c56435cc48e8920cb2ae91e968f191ebd1cca
parenta8c6fd0f96aa348711b144ffeb5bce517965ec7b (diff)
downloadmarkup-validator-c9ccbc99090ea0a836be108932cdd4404e052dd9.zip
markup-validator-c9ccbc99090ea0a836be108932cdd4404e052dd9.tar.gz
markup-validator-c9ccbc99090ea0a836be108932cdd4404e052dd9.tar.bz2
Make /check/path/info behave the same way as /check also when there's no URI available.
-rwxr-xr-xhttpd/cgi-bin/check29
1 files changed, 16 insertions, 13 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 6a0c333..b03f15a 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -14,7 +14,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.475 2007-03-12 20:29:55 ville Exp $
+# $Id: check,v 1.476 2007-03-12 20:38:42 ville Exp $
#
# Disable buffering on STDOUT!
@@ -180,7 +180,7 @@ Directory not readable (permission denied): @_r
#
# Strings
- $VERSION = q$Revision: 1.475 $;
+ $VERSION = q$Revision: 1.476 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
#
@@ -1903,23 +1903,26 @@ sub charset_not_equal {
# Construct a self-referential URL from a CGI.pm $q object.
sub self_url_q {
my ($q, $File) = @_;
- my $thispage = $File->{Env}->{'Self URI'};
- $thispage .= '?uri=' . uri_escape($q->param('uri'));
- $thispage .= ';ss=1' if $q->param('ss');
- $thispage .= ';sp=1' if $q->param('sp');
- $thispage .= ';noatt=1' if $q->param('noatt');
- $thispage .= ';outline=1' if $q->param('outline');
- $thispage .= ';No200=1' if $q->param('No200');
- $thispage .= ';verbose=1' if $q->param('verbose');
- $thispage .= ';group=1' if $q->param('group');
+ my $thispage = $File->{Env}->{'Self URI'} . '?';
+ $thispage .= 'uri=' . uri_escape($q->param('uri')) . ';'
+ if $q->param('uri');
+ $thispage .= 'ss=1;' if $q->param('ss');
+ $thispage .= 'sp=1;' if $q->param('sp');
+ $thispage .= 'noatt=1;' if $q->param('noatt');
+ $thispage .= 'outline=1;' if $q->param('outline');
+ $thispage .= 'No200=1;' if $q->param('No200');
+ $thispage .= 'verbose=1;' if $q->param('verbose');
+ $thispage .= 'group=1;' if $q->param('group');
if ($q->param('doctype')
and not $q->param('doctype') =~ /(Inline|detect)/i) {
- $thispage .= ';doctype=' . uri_escape($q->param('doctype'));
+ $thispage .= 'doctype=' . uri_escape($q->param('doctype')) . ';';
}
if ($q->param('charset') and not $q->param('charset') =~ /detect/i) {
- $thispage .= ';charset=' . uri_escape($q->param('charset'));
+ $thispage .= 'charset=' . uri_escape($q->param('charset')) . ';';
}
+
+ $thispage =~ s/[\?;]$//;
return $thispage;
}