aboutsummaryrefslogtreecommitdiffhomepage
path: root/html/fileshow.html
blob: 94df8538ae1467ca69e34a9432f36a1754cd84eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
  require('functions.php3');
  require('elispmarkup.php3');
  $filename=$HTTP_GET_VARS["file"];
  $title=$HTTP_GET_VARS["title"];
  $expanded=$HTTP_GET_VARS["expanded"];
  if ($title=="") { $title = $filename; };
  small_header($title);
  print "<pre>\n";
  /* I hope this is enough to prevent access outside cwd */
  if (substr($filename,0,1)=="." or 
      substr($filename,0,1)=="/" or
      substr($filename,0,1)=="~") {
     print "Sorry, can't show you that file!\n"; 
  } elseif (substr($filename,-3)==".el") {
     elisp_markup($filename,"fileshow.html");
  } else {
     outline_markup($filename,"fileshow.html",$expanded);
  }
  print "</pre>\n";
  print "<hr>";
  click_to_go_back();
  footer();
?>