(file) Return to browser.cgi CVS log (file) (dir) Up to [app-findlib-browser] / browser.cgi

Diff for /browser.cgi between version 1 and 4

version 1, Sun Jan 4 19:43:45 2004 UTC version 4, Sun Aug 1 11:39:35 2004 UTC
Line 18 
Line 18 
   
 (* ---------------------------------------------------------------------- *)  (* ---------------------------------------------------------------------- *)
   
 let args = lazy begin Cgi.parse_args() end;;  let cgi = new Netcgi.std_activation
               ~operating_type:Netcgi.buffered_transactional_optype ();;
   
 let param n = List.assoc n (Lazy.force args);;  let param n = (cgi # argument n) # value;;
   
   let print s = cgi # output # output_string s;;
   
   let cancel() = cgi # output # rollback_work();;
   
   let commit() = cgi # output # commit_work();;
   
 (* ---------------------------------------------------------------------- *)  (* ---------------------------------------------------------------------- *)
   
Line 78 
Line 85 
   
 (* ---------------------------------------------------------------------- *)  (* ---------------------------------------------------------------------- *)
   
 let outbuf = Buffer.create 50000;;  let escape_html =
     Netencoding.Html.encode ~in_enc:`Enc_iso88591 ()
 let print s = Buffer.add_string outbuf s;;  
   
 let cancel() = Buffer.clear outbuf;;  
   
 let commit() = Buffer.output_buffer stdout outbuf;;  
   
 (* ---------------------------------------------------------------------- *)  
   
 let escape_html s =  
   Str.global_substitute  
     (Str.regexp "<\\|>\\|&\\|\"")  
     (fun s ->  
       match Str.matched_string s with  
         "<" -> "&lt;"  
       | ">" -> "&gt;"  
       | "&" -> "&amp;"  
       | "\"" -> "&quot;"  
       | _ -> assert false)  
     s  
 ;;  ;;
   
   
Line 213 
Line 201 
   
   let pkg_url p =    let pkg_url p =
     "<a href=\"browser.cgi?" ^      "<a href=\"browser.cgi?" ^
     "pkg=" ^ Cgi.encode p ^      "pkg=" ^ Netencoding.Url.encode p ^
     "\">" ^      "\">" ^
     escape_html p ^      escape_html p ^
     "</a>"      "</a>"
Line 221 
Line 209 
   
   let mod_url p m =    let mod_url p m =
     "<a href=\"browser.cgi?" ^      "<a href=\"browser.cgi?" ^
     "pkg=" ^ Cgi.encode p ^      "pkg=" ^ Netencoding.Url.encode p ^
     "&mod=" ^ Cgi.encode m ^      "&mod=" ^ Netencoding.Url.encode m ^
     "\">" ^      "\">" ^
     escape_html m ^      escape_html m ^
     "</a>"      "</a>"
Line 230 
Line 218 
   
   let mod_url_hl p m hl =    let mod_url_hl p m hl =
     "<a href=\"browser.cgi?" ^      "<a href=\"browser.cgi?" ^
     "pkg=" ^ Cgi.encode p ^      "pkg=" ^ Netencoding.Url.encode p ^
     "&mod=" ^ Cgi.encode m ^      "&mod=" ^ Netencoding.Url.encode m ^
     "&hlight=" ^ Cgi.encode hl ^      "&hlight=" ^ Netencoding.Url.encode hl ^
     "\">" ^      "\">" ^
     escape_html m ^      escape_html m ^
     "</a>"      "</a>"


Legend:
Removed from v.1  
changed lines
  Added in v.4

SVN admin
Powered by
ViewCVS 1.0-dev