validator/httpd/cgi-bin check,1.475,1.476

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv19650

Modified Files:
	check 
Log Message:
Make /check/path/info behave the same way as /check also when there's no URI available.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.475
retrieving revision 1.476
diff -u -d -r1.475 -r1.476
--- check	12 Mar 2007 20:29:55 -0000	1.475
+++ check	12 Mar 2007 20:38:42 -0000	1.476
@@ -1903,23 +1903,26 @@
 # 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;
 }
 

Received on Monday, 12 March 2007 20:38:49 UTC