diff options
| author | xXx-caillou-xXx | 2018-08-28 14:24:29 +0200 |
|---|---|---|
| committer | jvoisin | 2018-08-28 12:24:29 +0000 |
| commit | aa5d6895d0ac8c6ea050a8ea55e2f8a39ddfe365 (patch) | |
| tree | c640e50ab007bae3a2fd55ca05bc13c73e293c69 /src/sp_pcre_compat.c | |
| parent | eff2c658d37108020215f838d4c47c176ec3e050 (diff) | |
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
Diffstat (limited to 'src/sp_pcre_compat.c')
| -rw-r--r-- | src/sp_pcre_compat.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 @@ | |||
| 4 | 4 | ||
| 5 | sp_pcre* sp_pcre_compile(const char* const pattern) { | 5 | sp_pcre* sp_pcre_compile(const char* const pattern) { |
| 6 | sp_pcre* ret = NULL; | 6 | sp_pcre* ret = NULL; |
| 7 | const char* pcre_error = NULL; | ||
| 8 | #ifdef SP_HAS_PCRE2 | 7 | #ifdef SP_HAS_PCRE2 |
| 8 | char pcre_error[128] = {0}; | ||
| 9 | int errornumber; | 9 | int errornumber; |
| 10 | PCRE2_SIZE erroroffset; | 10 | PCRE2_SIZE erroroffset; |
| 11 | ret = pcre2_compile((PCRE2_SPTR)pattern, PCRE2_ZERO_TERMINATED, | 11 | ret = pcre2_compile((PCRE2_SPTR)pattern, PCRE2_ZERO_TERMINATED, |
| 12 | PCRE2_CASELESS, &errornumber, &erroroffset, NULL); | 12 | PCRE2_CASELESS, &errornumber, &erroroffset, NULL); |
| 13 | pcre2_get_error_message(errornumber, pcre_error, sizeof(pcre_error)); | ||
| 13 | #else | 14 | #else |
| 15 | const char* pcre_error = NULL; | ||
| 14 | int erroroffset; | 16 | int erroroffset; |
| 15 | ret = pcre_compile(pattern, PCRE_CASELESS, &pcre_error, &erroroffset, NULL); | 17 | ret = pcre_compile(pattern, PCRE_CASELESS, &pcre_error, &erroroffset, NULL); |
| 16 | #endif | 18 | #endif |
