]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_lua: Reformat and escape script error output.
authorDaniel Gruno <humbedooh@apache.org>
Thu, 27 Mar 2014 10:44:43 +0000 (10:44 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Thu, 27 Mar 2014 10:44:43 +0000 (10:44 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1582247 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/mod_lua.c

index 8b17b84c9e8b3972bcf4af548a18882b785cb3d6..6cf2fe521fd09c50b75f22d795a6c6300b275ad0 100644 (file)
@@ -99,11 +99,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);