From ca2fcd32c41d72893bbb45bda4640c3589699113 Mon Sep 17 00:00:00 2001 From: Wilmer Ricciotti Date: Wed, 20 Jul 2011 16:11:12 +0000 Subject: [PATCH] Matitaweb: fixed a bug concerning matita/html/xml escaping, which showed when retrieving some nasty scripts from the server. --- matitaB/matita/matitadaemon.ml | 8 ++++---- matitaB/matita/matitaweb.js | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/matitaB/matita/matitadaemon.ml b/matitaB/matita/matitadaemon.ml index 9e6b11c6f..5d745eab7 100644 --- a/matitaB/matita/matitadaemon.ml +++ b/matitaB/matita/matitadaemon.ml @@ -205,12 +205,12 @@ let retrieve (cgi : Netcgi1_compat.Netcgi_types.cgi_activation) = let filename = libdir uid ^ "/" ^ (cgi # argument_value "file") in prerr_endline ("reading file " ^ filename); let body = - (* Netencoding.Html.encode ~in_enc:`Enc_utf8 ~prefer_name:false () + Netencoding.Html.encode ~in_enc:`Enc_utf8 ~prefer_name:false () (html_of_matita (read_file filename)) in - *) - html_of_matita (read_file filename) in + + (* html_of_matita (read_file filename) in *) prerr_endline ("sending:\nBEGIN\n" ^ body ^ "\nEND"); - let body = "" ^ body ^ "" in + let body = "" ^ body ^ "" in let baseuri, incpaths = try let root, baseuri, _fname, _tgt = diff --git a/matitaB/matita/matitaweb.js b/matitaB/matita/matitaweb.js index 04787ce77..fb6c0869d 100644 --- a/matitaB/matita/matitaweb.js +++ b/matitaB/matita/matitaweb.js @@ -607,8 +607,9 @@ function retrieveFile(thefile) { if (is_defined(xml)) { locked.innerHTML = ""; - debug(xml.documentElement.textContent); - unlocked.innerHTML = xml.documentElement.textContent; + debug(xml.getElementsByTagName("file")[0].childNodes[0].nodeValue); + unlocked.innerHTML = xml.getElementsByTagName("file")[0].childNodes[0].nodeValue; + } else { debug("file open failed"); } -- 2.39.2