--- web/cgi-bin/docs.cgi 2004/03/21 23:59:32 1.7 +++ web/cgi-bin/docs.cgi 2004/03/24 13:11:42 1.8 @@ -6,17 +6,22 @@ use CGI; $| = 1; # Settings -my ($menu) = "../nwww/menu.inc" ; -my ($header) = "../nwww/header.inc"; -my ($footer) = "../nwww/footer.inc"; -my ($style) = "../nwww/style.inc"; +my ($incdir) = "../nwww"; +# Include files +my ($doctype) = "$incdir/doctype.inc"; +my ($style) = "$incdir/style.inc"; +my ($header) = "$incdir/header.inc"; +my ($footer) = "$incdir/footer.inc"; +my ($menu) = "$incdir/menu.inc" ; + my ($query) = new CGI; # Note filenames may only have one dot in them, in the ".txt". # This prevents malicious users using "../" to view files. my ($doc) = ($query->param('doc') =~ /^\s*([^\.]*?\.txt)\s*$/); +# This should be application/xhtml+xml print "Content-type: text/html\n\n"; unless (defined $doc) { @@ -34,50 +39,59 @@ $doc = "../htdocs/documentation/".$doc; my($docname) = $doc =~ /\/([^\/]+)$/; +&print_html($doctype); + print <<"END"; - - - -
-\n"; + print ""; } else { print "Failed to open $docname.";\n"; # Use $_ implicitly throughout. while ("; + print "\n) { # Must do the next line first! @@ -112,7 +126,7 @@ if(open(FILE, $filename)) { s/\b($urls:[$any]+?)(?=[$punc]*[^$any]|$)/$1<\/a>/igox; print; } - print "