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:
@@ -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(®ex, pattern, 0);
|
||||
rv = ap_regcomp(®ex, pattern, flags);
|
||||
if (rv) {
|
||||
lua_pushboolean(L, 0);
|
||||
err = apr_palloc(r->pool, 256);
|
||||
|
Reference in New Issue
Block a user