mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Refactor code and build system to use libpcre2 as the default
This commit is contained in:
@@ -388,7 +388,7 @@ int do_hash_method(modsec_rec *msr, char *link, int type) {
|
||||
case HASH_URL_HREF_HASH_RX:
|
||||
if(em[i]->type == HASH_URL_HREF_HASH_RX) {
|
||||
rc = msc_regexec_capture(em[i]->param_data, link, strlen(link), ovector, 30, &my_error_msg);
|
||||
#ifdef WITH_PCRE2
|
||||
#ifndef WITH_PCRE
|
||||
if ((rc == PCRE2_ERROR_MATCHLIMIT) || (rc == PCRE2_ERROR_RECURSIONLIMIT)) {
|
||||
#else
|
||||
if ((rc == PCRE_ERROR_MATCHLIMIT) || (rc == PCRE_ERROR_RECURSIONLIMIT)) {
|
||||
@@ -421,7 +421,7 @@ int do_hash_method(modsec_rec *msr, char *link, int type) {
|
||||
msr_log(msr, 4, "%s.", error_msg);
|
||||
return -1;
|
||||
}
|
||||
#ifdef WITH_PCRE2
|
||||
#ifndef WITH_PCRE
|
||||
if (rc != PCRE2_ERROR_NOMATCH) { /* Match. */
|
||||
#else
|
||||
if (rc != PCRE_ERROR_NOMATCH) { /* Match. */
|
||||
@@ -451,7 +451,7 @@ int do_hash_method(modsec_rec *msr, char *link, int type) {
|
||||
case HASH_URL_FACTION_HASH_RX:
|
||||
if(em[i]->type == HASH_URL_FACTION_HASH_RX) {
|
||||
rc = msc_regexec_capture(em[i]->param_data, link, strlen(link), ovector, 30, &my_error_msg);
|
||||
#ifdef WITH_PCRE2
|
||||
#ifndef WITH_PCRE
|
||||
if ((rc == PCRE2_ERROR_MATCHLIMIT) || (rc == PCRE2_ERROR_RECURSIONLIMIT)) {
|
||||
#else
|
||||
if ((rc == PCRE_ERROR_MATCHLIMIT) || (rc == PCRE_ERROR_RECURSIONLIMIT)) {
|
||||
@@ -484,7 +484,7 @@ int do_hash_method(modsec_rec *msr, char *link, int type) {
|
||||
msr_log(msr, 4, "%s.", error_msg);
|
||||
return -1;
|
||||
}
|
||||
#ifdef WITH_PCRE2
|
||||
#ifndef WITH_PCRE
|
||||
if (rc != PCRE2_ERROR_NOMATCH) { /* Match. */
|
||||
#else
|
||||
if (rc != PCRE_ERROR_NOMATCH) { /* Match. */
|
||||
@@ -514,7 +514,7 @@ int do_hash_method(modsec_rec *msr, char *link, int type) {
|
||||
case HASH_URL_LOCATION_HASH_RX:
|
||||
if(em[i]->type == HASH_URL_LOCATION_HASH_RX) {
|
||||
rc = msc_regexec_capture(em[i]->param_data, link, strlen(link), ovector, 30, &my_error_msg);
|
||||
#ifdef WITH_PCRE2
|
||||
#ifndef WITH_PCRE
|
||||
if ((rc == PCRE2_ERROR_MATCHLIMIT) || (rc == PCRE2_ERROR_RECURSIONLIMIT)) {
|
||||
#else
|
||||
if ((rc == PCRE_ERROR_MATCHLIMIT) || (rc == PCRE_ERROR_RECURSIONLIMIT)) {
|
||||
@@ -547,7 +547,7 @@ int do_hash_method(modsec_rec *msr, char *link, int type) {
|
||||
msr_log(msr, 4, "%s.", error_msg);
|
||||
return -1;
|
||||
}
|
||||
#ifdef WITH_PCRE2
|
||||
#ifndef WITH_PCRE
|
||||
if (rc != PCRE2_ERROR_NOMATCH) { /* Match. */
|
||||
#else
|
||||
if (rc != PCRE_ERROR_NOMATCH) { /* Match. */
|
||||
@@ -577,7 +577,7 @@ int do_hash_method(modsec_rec *msr, char *link, int type) {
|
||||
case HASH_URL_IFRAMESRC_HASH_RX:
|
||||
if(em[i]->type == HASH_URL_IFRAMESRC_HASH_RX) {
|
||||
rc = msc_regexec_capture(em[i]->param_data, link, strlen(link), ovector, 30, &my_error_msg);
|
||||
#ifdef WITH_PCRE2
|
||||
#ifndef WITH_PCRE
|
||||
if ((rc == PCRE2_ERROR_MATCHLIMIT) || (rc == PCRE2_ERROR_RECURSIONLIMIT)) {
|
||||
#else
|
||||
if ((rc == PCRE_ERROR_MATCHLIMIT) || (rc == PCRE_ERROR_RECURSIONLIMIT)) {
|
||||
@@ -610,7 +610,7 @@ int do_hash_method(modsec_rec *msr, char *link, int type) {
|
||||
msr_log(msr, 4, "%s.", error_msg);
|
||||
return -1;
|
||||
}
|
||||
#ifdef WITH_PCRE2
|
||||
#ifndef WITH_PCRE
|
||||
if (rc != PCRE2_ERROR_NOMATCH) { /* Match. */
|
||||
#else
|
||||
if (rc != PCRE_ERROR_NOMATCH) { /* Match. */
|
||||
@@ -640,7 +640,7 @@ int do_hash_method(modsec_rec *msr, char *link, int type) {
|
||||
case HASH_URL_FRAMESRC_HASH_RX:
|
||||
if(em[i]->type == HASH_URL_FRAMESRC_HASH_RX) {
|
||||
rc = msc_regexec_capture(em[i]->param_data, link, strlen(link), ovector, 30, &my_error_msg);
|
||||
#ifdef WITH_PCRE2
|
||||
#ifndef WITH_PCRE
|
||||
if ((rc == PCRE2_ERROR_MATCHLIMIT) || (rc == PCRE2_ERROR_RECURSIONLIMIT)) {
|
||||
#else
|
||||
if ((rc == PCRE_ERROR_MATCHLIMIT) || (rc == PCRE_ERROR_RECURSIONLIMIT)) {
|
||||
@@ -673,7 +673,7 @@ int do_hash_method(modsec_rec *msr, char *link, int type) {
|
||||
msr_log(msr, 4, "%s.", error_msg);
|
||||
return -1;
|
||||
}
|
||||
#ifdef WITH_PCRE2
|
||||
#ifndef WITH_PCRE
|
||||
if (rc != PCRE2_ERROR_NOMATCH) { /* Match. */
|
||||
#else
|
||||
if (rc != PCRE_ERROR_NOMATCH) { /* Match. */
|
||||
|
Reference in New Issue
Block a user