Bug #77514 [Asn->Csd]: mb_ereg_replace() with trailing backslash adds null byte
| From: | nikic@php.net | Date: | Thu, 24 Jan 2019 14:24:30 +0000 |
| Subject: | Bug #77514 [Asn->Csd]: mb_ereg_replace() with trailing backslash adds null byte | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219173@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77514&edit=1
ID: 77514
Updated by: nikic@php.net
Reported by: legale dot legale at gmail dot com
Summary: mb_ereg_replace() with trailing backslash adds null
byte
-Status: Assigned
+Status: Closed
Type: Bug
Package: mbstring related
Operating System: linux
PHP Version: 7.3.1
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3c98c2d0cbf476432a4fa6264afc5e43c58fb38f
Log: Fixed bug #77514
Previous Comments:
------------------------------------------------------------------------
[2019-01-24 13:07:14] cmb@php.net
Confirmed: <https://3v4l.org/PHfJA>.
------------------------------------------------------------------------
[2019-01-24 12:53:20] legale dot legale at gmail dot com
Description:
------------
Function returns incorrect result.
Test script:
---------------
<?php
$a="abc123";
echo unpack("H*", mb_ereg_replace("123","def\\",$a))[1];
echo PHP_EOL;
Expected result:
----------------
61626364655c
Actual result:
--------------
61626364655c00
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77514&edit=1