From: Daniel Gruno Date: Thu, 27 Mar 2014 10:47:35 +0000 (+0000) Subject: mod_lua: Reformat and escape script error output. X-Git-Tag: 2.4.10~402 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b61caf3b90f480ee65b65cf2a5f30927c6c6339;p=apache mod_lua: Reformat and escape script error output. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1582251 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index e0aaf15a17..36af84a928 100644 --- 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 ] + *) mod_lua: Reformat and escape script error output. + [Daniel Gruno, Felipe Daragon ] + Changes with Apache 2.4.9 *) mod_ssl: Work around a bug in some older versions of OpenSSL that diff --git a/modules/lua/mod_lua.c b/modules/lua/mod_lua.c index 8f09cfe1fb..8e006319e9 100644 --- a/modules/lua/mod_lua.c +++ b/modules/lua/mod_lua.c @@ -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("Error!\n", r); - ap_rputs("

", r); + ap_rputs("

Error!

\n", r); + ap_rputs("
", r);
     lua_response = lua_tostring(L, -1);
-    ap_rputs(lua_response, r);
-    ap_rputs("

\n", r); + ap_rputs(ap_escape_html(r->pool, lua_response), r); + ap_rputs("
\n", r); ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, r->pool, APLOGNO(01471) "Lua error: %s", lua_response);