@@ -1426,19 +1426,19 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
14261426 size_t arg_pattern_len , arg_options_len ;
14271427 int err ;
14281428 size_t n , i , pos , len , beg , end ;
1429- OnigOptionType option ;
1429+ OnigOptionType option = 0 ;
14301430 OnigUChar * str ;
14311431 OnigSyntaxType * syntax ;
14321432
14331433 if (zend_parse_parameters (ZEND_NUM_ARGS (), "|ss" , & arg_pattern , & arg_pattern_len , & arg_options , & arg_options_len ) == FAILURE ) {
14341434 return ;
14351435 }
14361436
1437- option = MBREX (regex_default_options );
1438-
14391437 if (arg_options ) {
1440- option = 0 ;
14411438 _php_mb_regex_init_options (arg_options , arg_options_len , & option , & syntax , NULL );
1439+ } else {
1440+ option |= MBREX (regex_default_options );
1441+ syntax = MBREX (regex_default_syntax );
14421442 }
14431443
14441444 if (MBREX (search_regs )) {
@@ -1448,7 +1448,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
14481448
14491449 if (arg_pattern ) {
14501450 /* create regex pattern buffer */
1451- if ((MBREX (search_re ) = php_mbregex_compile_pattern (arg_pattern , arg_pattern_len , option , MBREX (current_mbctype ), MBREX ( regex_default_syntax ) )) == NULL ) {
1451+ if ((MBREX (search_re ) = php_mbregex_compile_pattern (arg_pattern , arg_pattern_len , option , MBREX (current_mbctype ), syntax )) == NULL ) {
14521452 RETURN_FALSE ;
14531453 }
14541454 }
0 commit comments