mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Added t:length to transform a value to its character length. See #55.
This commit is contained in:
parent
5482606c37
commit
b93eef9db3
2
CHANGES
2
CHANGES
@ -2,6 +2,8 @@
|
|||||||
?? ??? 2007 - trunk
|
?? ??? 2007 - trunk
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
* Added t:length to transform a value to its character length.
|
||||||
|
|
||||||
* Added t:trimLeft, t:trimRight, t:trim to remove whitespace
|
* Added t:trimLeft, t:trimRight, t:trim to remove whitespace
|
||||||
from a value on the left, right or both.
|
from a value on the left, right or both.
|
||||||
|
|
||||||
|
@ -319,6 +319,17 @@ static int msre_fn_base64Decode_execute(apr_pool_t *mptmp, unsigned char *input,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* length */
|
||||||
|
|
||||||
|
static int msre_fn_length_execute(apr_pool_t *mptmp, unsigned char *input,
|
||||||
|
long int input_len, char **rval, long int *rval_len)
|
||||||
|
{
|
||||||
|
*rval = apr_psprintf(mptmp, "%ld", input_len);
|
||||||
|
*rval_len = strlen(*rval);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* md5 */
|
/* md5 */
|
||||||
|
|
||||||
static int msre_fn_md5_execute(apr_pool_t *mptmp, unsigned char *input,
|
static int msre_fn_md5_execute(apr_pool_t *mptmp, unsigned char *input,
|
||||||
@ -496,6 +507,12 @@ void msre_engine_register_default_tfns(msre_engine *engine) {
|
|||||||
msre_fn_htmlEntityDecode_execute
|
msre_fn_htmlEntityDecode_execute
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* length */
|
||||||
|
msre_engine_tfn_register(engine,
|
||||||
|
"length",
|
||||||
|
msre_fn_length_execute
|
||||||
|
);
|
||||||
|
|
||||||
/* lowercase */
|
/* lowercase */
|
||||||
msre_engine_tfn_register(engine,
|
msre_engine_tfn_register(engine,
|
||||||
"lowercase",
|
"lowercase",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user