You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stefan Fritsch <sf...@sfritsch.de> on 2011/11/08 00:47:47 UTC
Re: svn commit: r1197838 -
/httpd/httpd/trunk/modules/lua/lua_request.c
On Sat, 5 Nov 2011, covener@apache.org wrote:
> Author: covener
> Date: Sat Nov 5 00:16:36 2011
> New Revision: 1197838
>
> URL: http://svn.apache.org/viewvc?rev=1197838&view=rev
> Log:
> provide ap_escape_html as r:escape_html()
>
> Modified:
> httpd/httpd/trunk/modules/lua/lua_request.c
>
> Modified: httpd/httpd/trunk/modules/lua/lua_request.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_request.c?rev=1197838&r1=1197837&r2=1197838&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/lua/lua_request.c (original)
> +++ httpd/httpd/trunk/modules/lua/lua_request.c Sat Nov 5 00:16:36 2011
> @@ -208,6 +208,15 @@ static int req_construct_url(lua_State *
> lua_pushstring(L, ap_construct_url(r->pool, name, r));
> return 1;
> }
> +
> +/* wrap ap_escape_html r:escape_html(String) */
> +static char * req_escape_html(lua_State *L)
> +{
> + request_rec *r = ap_lua_check_request_rec(L, 1);
> + const char *s = luaL_checkstring(L, 2);
> + lua_pushstring(L, ap_escape_html(r->pool, s));
> + return 1;
> +}
> /* BEGIN dispatch mathods for request_rec fields */
>
Returning 1 in a function returning 'char *' is wrong. I suspect the
prototype should be 'int'?
Re: svn commit: r1197838 - /httpd/httpd/trunk/modules/lua/lua_request.c
Posted by Eric Covener <co...@gmail.com>.
> Returning 1 in a function returning 'char *' is wrong. I suspect the
> prototype should be 'int'?
thanks, tripped on this myself and fixed in r1199028