Avoid XML errors

This commit is contained in:
Steven Barth 2008-09-12 16:12:51 +00:00
parent 2bbc4eb3c3
commit 871f07ad2e
3 changed files with 10 additions and 6 deletions

View file

@ -192,6 +192,7 @@ end
--- Set the mime type of following content data. --- Set the mime type of following content data.
-- @param mime Mimetype of following content -- @param mime Mimetype of following content
function prepare_content(mime) function prepare_content(mime)
if not context.headers or not context.headers["content-type"] then
if mime == "application/xhtml+xml" then if mime == "application/xhtml+xml" then
if not getenv("HTTP_ACCEPT") or if not getenv("HTTP_ACCEPT") or
not getenv("HTTP_ACCEPT"):find("application/xhtml+xml", nil, true) then not getenv("HTTP_ACCEPT"):find("application/xhtml+xml", nil, true) then
@ -201,6 +202,7 @@ function prepare_content(mime)
end end
header("Content-Type", mime) header("Content-Type", mime)
end end
end
--- Get the RAW HTTP input source --- Get the RAW HTTP input source
-- @return HTTP LTN12 source -- @return HTTP LTN12 source

View file

@ -213,6 +213,7 @@ function action_upgrade()
end end
end end
luci.http.prepare_content("text/html")
luci.template.render("admin_system/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail}) luci.template.render("admin_system/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail})
end end

View file

@ -110,6 +110,7 @@ function action_upgrade()
end end
end end
luci.http.prepare_content("text/html")
luci.template.render("mini/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail}) luci.template.render("mini/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail})
end end