]> granicus.if.org Git - php/commitdiff
Fix #76113: mbstring does not build with Oniguruma 6.8.1
authorChristoph M. Becker <cmbecker69@gmx.de>
Tue, 20 Mar 2018 15:35:39 +0000 (16:35 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 20 Mar 2018 15:42:28 +0000 (16:42 +0100)
As of Oniguruma 6.8.1, the regex structure has been moved from the
public `oniguruma.h` to the private `regint.h`.  Thus, it is no longer
possible to directly access the struct's members, and actually, there
is no need to, since there are respective accessor functions available
at least of 2.3.1.

NEWS
ext/mbstring/php_mbregex.c

diff --git a/NEWS b/NEWS
index 921d9123d1ca113c2e6981a880a56120219e6971..d9febf7349bae799f597bec46faeae6898e4bdb1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ PHP                                                                        NEWS
 
 - Mbstring:
   . Fixed bug #75944 (Wrong cp1251 detection). (dmk001)
+  . Fixed bug #76113 (mbstring does not build with Oniguruma 6.8.1).
+    (chrullrich, cmb)
 
 
 29 Mar 2018, PHP 7.1.16
index a5a6cd08ad5884f64cd879d227622b88183f9aba..7a70c63b564e09cc494bc46174ef3d89c667711b 100644 (file)
@@ -452,7 +452,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl
        OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
 
        rc = zend_hash_str_find_ptr(&MBREX(ht_rc), (char *)pattern, patlen);
-       if (!rc || rc->options != options || rc->enc != enc || rc->syntax != syntax) {
+       if (!rc || onig_get_options(rc) != options || onig_get_encoding(rc) != enc || onig_get_syntax(rc) != syntax) {
                if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
                        onig_error_code_to_str(err_str, err_code, &err_info);
                        php_error_docref(NULL, E_WARNING, "mbregex compile err: %s", err_str);