1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

Added optional parameter flags to lua_ap_regex().

This enables to call r:regex() with a flag to do
case-insensitive matches.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1467188 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Guenter Knauf
2013-04-12 07:29:56 +00:00
parent acf05d4ee7
commit b610081619

View File

@@ -889,14 +889,15 @@ static int lua_ap_expr(lua_State *L)
/*
* lua_ap_regex; r:regex(string, pattern) - Evaluates a regex and returns
* captures if matched
* lua_ap_regex; r:regex(string, pattern [, flags])
* - Evaluates a regex and returns captures if matched
*/
static int lua_ap_regex(lua_State *L)
{
request_rec *r;
int i,
rv;
flags;
const char *pattern,
*source;
char *err;
@@ -909,8 +910,9 @@ static int lua_ap_regex(lua_State *L)
r = ap_lua_check_request_rec(L, 1);
pattern = lua_tostring(L, 2);
source = lua_tostring(L, 3);
flags = luaL_optinteger(L, 4, 0);
rv = ap_regcomp(&regex, pattern, 0);
rv = ap_regcomp(&regex, pattern, flags);
if (rv) {
lua_pushboolean(L, 0);
err = apr_palloc(r->pool, 256);