Bug #77558 [Opn->Dup]: mb_ereg_replace() does not properly handle stray backslashes

From: Date: Sat, 02 Feb 2019 19:01:55 +0000
Subject: Bug #77558 [Opn->Dup]: mb_ereg_replace() does not properly handle stray backslashes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219335@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77558&edit=1 ID: 77558 Updated by: cmb@php.net Reported by: codes at designsandcodes dot com Summary: mb_ereg_replace() does not properly handle stray backslashes -Status: Open +Status: Duplicate Type: Bug Package: mbstring related Operating System: * PHP Version: 7.3.1 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This looks like a duplicate of bug #77514, which will be fixed with PHP 7.3.2. Previous Comments: ------------------------------------------------------------------------ [2019-02-02 03:33:08] codes at designsandcodes dot com Description: ------------ Pre PHP 7.3, a stray backslash would be passed through in the replacement string, if it wasn't part of a backreference. Now, it gets passed through followed by a null character. Test script: --------------- var_export( mb_ereg_replace( '[\\\\/]', '\\', '/a/short/path' ) ); Expected result: ---------------- '\a\\short\\path' Actual result: -------------- '\\' . "\0" . 'a\\' . "\0" . 'short\\' . "\0" . 'path' ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77558&edit=1

« previous php.bugs (#219335) next »