mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix #76999: mb_regex_set_options() return current options
When setting new options, `mb_regex_set_options()` is supposed to return the *previous* options.
This commit is contained in:
parent
150df5b17c
commit
9e77d5a9da
3 changed files with 28 additions and 3 deletions
|
@ -1682,8 +1682,8 @@ static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *sy
|
|||
Set or get the default options for mbregex functions */
|
||||
PHP_FUNCTION(mb_regex_set_options)
|
||||
{
|
||||
OnigOptionType opt;
|
||||
OnigSyntaxType *syntax;
|
||||
OnigOptionType opt, prev_opt;
|
||||
OnigSyntaxType *syntax, *prev_syntax;
|
||||
char *string = NULL;
|
||||
size_t string_len;
|
||||
char buf[16];
|
||||
|
@ -1696,7 +1696,9 @@ PHP_FUNCTION(mb_regex_set_options)
|
|||
opt = 0;
|
||||
syntax = NULL;
|
||||
_php_mb_regex_init_options(string, string_len, &opt, &syntax, NULL);
|
||||
_php_mb_regex_set_options(opt, syntax, NULL, NULL);
|
||||
_php_mb_regex_set_options(opt, syntax, &prev_opt, &prev_syntax);
|
||||
opt = prev_opt;
|
||||
syntax = prev_syntax;
|
||||
} else {
|
||||
opt = MBREX(regex_default_options);
|
||||
syntax = MBREX(regex_default_syntax);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue