From aa5d6895d0ac8c6ea050a8ea55e2f8a39ddfe365 Mon Sep 17 00:00:00 2001 From: xXx-caillou-xXx Date: Tue, 28 Aug 2018 14:24:29 +0200 Subject: Use php's logging functions This commit replace our usage of `php_log_err` with `zend_error`. This should allow administrators to display errors in the webpage, should they want to; and to properly manipulate the verbosity's level. This should close #217 --- src/sp_pcre_compat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/sp_pcre_compat.c') diff --git a/src/sp_pcre_compat.c b/src/sp_pcre_compat.c index 795903d..3b3b7f5 100644 --- a/src/sp_pcre_compat.c +++ b/src/sp_pcre_compat.c @@ -4,13 +4,15 @@ sp_pcre* sp_pcre_compile(const char* const pattern) { sp_pcre* ret = NULL; - const char* pcre_error = NULL; #ifdef SP_HAS_PCRE2 + char pcre_error[128] = {0}; int errornumber; PCRE2_SIZE erroroffset; ret = pcre2_compile((PCRE2_SPTR)pattern, PCRE2_ZERO_TERMINATED, PCRE2_CASELESS, &errornumber, &erroroffset, NULL); + pcre2_get_error_message(errornumber, pcre_error, sizeof(pcre_error)); #else + const char* pcre_error = NULL; int erroroffset; ret = pcre_compile(pattern, PCRE_CASELESS, &pcre_error, &erroroffset, NULL); #endif -- cgit v1.3