mirror of
https://github.com/php/php-src.git
synced 2024-11-25 10:54:15 +08:00
Fix Bug #18341.
@- Fixed cases where preg_split() incorrectly terminated final element if @ it contained null byte. (Andrei)
This commit is contained in:
parent
da1a01ee93
commit
3650bab76f
@ -1245,8 +1245,9 @@ PHP_FUNCTION(preg_split)
|
||||
add_offset_pair(return_value, &Z_STRVAL_PP(subject)[start_offset], Z_STRLEN_PP(subject) - start_offset, start_offset);
|
||||
} else {
|
||||
/* Add the last piece to the return value */
|
||||
add_next_index_string(return_value,
|
||||
&Z_STRVAL_PP(subject)[start_offset], 1);
|
||||
add_next_index_stringl(return_value,
|
||||
&Z_STRVAL_PP(subject)[start_offset],
|
||||
Z_STRLEN_PP(subject) - start_offset, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user