MCPcopy Create free account
hub / github.com/apache/httpd / lua_ap_unescape

Function lua_ap_unescape

modules/lua/lua_request.c:912–929  ·  view source on GitHub ↗

* lua_ap_unescape; r:unescape(string) - Unescapes an URL-encoded string */

Source from the content-addressed store, hash-verified

910 * lua_ap_unescape; r:unescape(string) - Unescapes an URL-encoded string
911 */
912static int lua_ap_unescape(lua_State *L)
913{
914 const char *escaped;
915 char *plain;
916 size_t x,
917 y;
918 request_rec *r;
919 r = ap_lua_check_request_rec(L, 1);
920 luaL_checktype(L, 2, LUA_TSTRING);
921 escaped = lua_tolstring(L, 2, &x);
922 plain = apr_pstrdup(r->pool, escaped);
923 y = ap_unescape_urlencoded(plain);
924 if (!y) {
925 lua_pushstring(L, plain);
926 return 1;
927 }
928 return 0;
929}
930
931/*
932 * lua_ap_escape; r:escape(string) - URL-escapes a string

Callers

nothing calls this directly

Calls 2

ap_unescape_urlencodedFunction · 0.85
ap_lua_check_request_recFunction · 0.70

Tested by

no test coverage detected