mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed bug #77428
mb_ereg_replace historically has not supported escaping backslashes with backslashes. Go back to that behavior for BC reasons.
This commit is contained in:
parent
7f8cab2535
commit
76c687feaf
3 changed files with 19 additions and 1 deletions
|
@ -791,7 +791,9 @@ static inline void mb_regex_substitute(
|
|||
no = onig_name_to_backref_number(regexp, (OnigUChar *)name, (OnigUChar *)name_end, regs);
|
||||
break;
|
||||
default:
|
||||
p += clen;
|
||||
/* We're not treating \ as an escape character and will interpret something like
|
||||
* \\1 as \ followed by \1, rather than \\ followed by 1. This is because this
|
||||
* function has not supported escaping of backslashes historically. */
|
||||
smart_str_appendl(pbuf, sp, p - sp);
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue