]> granicus.if.org Git - apache/commitdiff
mod_lua: Reformat and escape script error output.
authorDaniel Gruno <humbedooh@apache.org>
Thu, 27 Mar 2014 10:47:35 +0000 (10:47 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Thu, 27 Mar 2014 10:47:35 +0000 (10:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1582251 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/lua/mod_lua.c

diff --git a/CHANGES b/CHANGES
index e0aaf15a17708b300355efb898fd4ce5d50f5651..36af84a928dd6036a6a8ef87f6b6e2eb7f7ef015 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,9 @@ Changes with Apache 2.4.10
   *) mod_lua: Log an error when the initial parsing of a Lua file fails.
      [Daniel Gruno, Felipe Daragon <filipe syhunt com>]
 
+  *) mod_lua: Reformat and escape script error output.
+     [Daniel Gruno, Felipe Daragon <filipe syhunt com>]
+
 Changes with Apache 2.4.9
 
   *) mod_ssl: Work around a bug in some older versions of OpenSSL that
index 8f09cfe1fb2879ac19e297c3bc886508fb0f0278..8e006319e97cd08d74e9fef5fcabbe78a3ea5a26 100644 (file)
@@ -75,11 +75,11 @@ static void report_lua_error(lua_State *L, request_rec *r)
     const char *lua_response;
     r->status = HTTP_INTERNAL_SERVER_ERROR;
     r->content_type = "text/html";
-    ap_rputs("<b>Error!</b>\n", r);
-    ap_rputs("<p>", r);
+    ap_rputs("<h3>Error!</h3>\n", r);
+    ap_rputs("<pre>", r);
     lua_response = lua_tostring(L, -1);
-    ap_rputs(lua_response, r);
-    ap_rputs("</p>\n", r);
+    ap_rputs(ap_escape_html(r->pool, lua_response), r);
+    ap_rputs("</pre>\n", r);
 
     ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, r->pool, APLOGNO(01471) "Lua error: %s",
                   lua_response);