} else {
pcre2_match_data *match_data = php_pcre_create_match_data(capture_count, pce);
if (match_data) {
- rv = pcre2_match(pce, m->desc, strlen(m->desc), 0, re_options, match_data, php_pcre_mctx()) > 0;
+ rv = pcre2_match(pce, (PCRE2_SPTR)m->desc, strlen(m->desc), 0, re_options, match_data, php_pcre_mctx()) > 0;
php_pcre_free_match_data(match_data);
}
}
if (!match_data) {
RETURN_VALIDATION_FAILED
}
- rc = pcre2_match(re, Z_STRVAL_P(value), Z_STRLEN_P(value), 0, preg_options, match_data, php_pcre_mctx());
+ rc = pcre2_match(re, (PCRE2_SPTR)Z_STRVAL_P(value), Z_STRLEN_P(value), 0, preg_options, match_data, php_pcre_mctx());
php_pcre_free_match_data(match_data);
/* 0 means that the vector is too small to hold all the captured substring offsets */
if (!match_data) {
RETURN_VALIDATION_FAILED
}
- rc = pcre2_match(re, Z_STRVAL_P(value), Z_STRLEN_P(value), 0, preg_options, match_data, php_pcre_mctx());
+ rc = pcre2_match(re, (PCRE2_SPTR)Z_STRVAL_P(value), Z_STRLEN_P(value), 0, preg_options, match_data, php_pcre_mctx());
php_pcre_free_match_data(match_data);
/* 0 means that the vector is too small to hold all the captured substring offsets */
}
it->next = NULL;
- if ((it->re = pcre2_compile(regexp, PCRE2_ZERO_TERMINATED, PCRE2_NO_AUTO_CAPTURE, &errnumber, &pcre_error_offset, cctx)) == NULL) {
+ if ((it->re = pcre2_compile((PCRE2_SPTR)regexp, PCRE2_ZERO_TERMINATED, PCRE2_NO_AUTO_CAPTURE, &errnumber, &pcre_error_offset, cctx)) == NULL) {
free(it);
pcre2_get_error_message(errnumber, pcre_error, sizeof(pcre_error));
- blacklist_report_regexp_error(pcre_error, pcre_error_offset);
+ blacklist_report_regexp_error((char *)pcre_error, pcre_error_offset);
return;
}
/* prepare for the next iteration */
/* Alloc failed, but next one could still come through and match. */
continue;
}
- int rc = pcre2_match(regexp_list_it->re, verify_path, strlen(verify_path), 0, 0, match_data, mctx);
+ int rc = pcre2_match(regexp_list_it->re, (PCRE2_SPTR)verify_path, strlen(verify_path), 0, 0, match_data, mctx);
if (rc >= 0) {
ret = 1;
php_pcre_free_match_data(match_data);
options |= PCRE2_CASELESS;
}
- re = pcre2_compile(regex, PCRE2_ZERO_TERMINATED, options, &errnumber, &err_offset, php_pcre_cctx());
+ re = pcre2_compile((PCRE2_SPTR)regex, PCRE2_ZERO_TERMINATED, options, &errnumber, &err_offset, php_pcre_cctx());
if (NULL == re) {
pcre2_get_error_message(errnumber, err_msg, sizeof(err_msg));
php_error_docref(NULL, E_WARNING, "Cannot compile regex: '%s'", err_msg);
php_error_docref(NULL, E_WARNING, "Cannot allocate match data");
return FAILURE;
}
- res = pcre2_match(re, str, str_len, 0, 0, match_data, php_pcre_mctx());
+ res = pcre2_match(re, (PCRE2_SPTR)str, str_len, 0, 0, match_data, php_pcre_mctx());
php_pcre_free_match_data(match_data);
pcre2_code_free(re);
if (!match_data) {
RETURN_FALSE;
}
- rc = pcre2_match(re, ZSTR_VAL(subject), ZSTR_LEN(subject), 0, 0, match_data, php_pcre_mctx());
+ rc = pcre2_match(re, (PCRE2_SPTR)ZSTR_VAL(subject), ZSTR_LEN(subject), 0, 0, match_data, php_pcre_mctx());
RETVAL_BOOL(rc >= 0);
php_pcre_free_match_data(match_data);
break;
zend_string_release(regex);
return 0;
}
- rc = pcre2_match(re, ZSTR_VAL(agent_name), ZSTR_LEN(agent_name), 0, re_options, match_data, php_pcre_mctx());
+ rc = pcre2_match(re, (PCRE2_SPTR)ZSTR_VAL(agent_name), ZSTR_LEN(agent_name), 0, re_options, match_data, php_pcre_mctx());
php_pcre_free_match_data(match_data);
if (PCRE2_ERROR_NOMATCH != rc) {
/* If we've found a possible browser, we need to do a comparison of the
zend_string_release(namelist[i]);
continue;
}
- rc = pcre2_match(re, ZSTR_VAL(namelist[i]), ZSTR_LEN(namelist[i]), 0, preg_options, match_data, mctx);
+ rc = pcre2_match(re, (PCRE2_SPTR)ZSTR_VAL(namelist[i]), ZSTR_LEN(namelist[i]), 0, preg_options, match_data, mctx);
php_pcre_free_match_data(match_data);
/* 0 means that the vector is too small to hold all the captured substring offsets */
if (rc < 0) {