Bug #72711 [Ver->Csd]: `mb_ereg` does not clear the `$regs` parameter on failure
| From: | cmb@php.net | Date: | Fri, 05 Aug 2016 11:31:49 +0000 |
| Subject: | Bug #72711 [Ver->Csd]: `mb_ereg` does not clear the `$regs` parameter on failure | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-202955@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72711&edit=1
ID: 72711
Updated by: cmb@php.net
Reported by: ju1ius at laposte dot net
Summary:
mb_ereg does not clear the $regs parameter on
failure
-Status: Verified
+Status: Closed
Type: Bug
Package: mbstring related
Operating System: Debian Sid
PHP Version: 5.6.24
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of ju1ius@laposte.net
Revision: http://git.php.net/?p=php-src.git;a=commit;h=03d03243fa09634895378923b53360e40a608c82
Log: Fix #72711: mb_ereg does not clear the $regs parameter on failure
Previous Comments:
------------------------------------------------------------------------
[2016-07-30 23:13:10] cmb@php.net
See test cases of <https://github.com/php/php-src/pull/2046>.
------------------------------------------------------------------------
[2016-07-30 11:55:29] ju1ius at laposte dot net
Description:
------------
When mb_ereg does not match, it does not empty the $regs array parameters.
Test script:
---------------
<?php
var_dump(mb_ereg('(a)\1', 'aa', $m));
var_dump($m);
var_dump(mb_ereg('(a)\1', 'ab', $m));
var_dump($m);
var_dump(mb_ereg('(foo)\1', 'foofoo', $m));
var_dump($m);
Expected result:
----------------
int(2)
array(2) {
[0]=>
string(2) "aa"
[1]=>
string(1) "a"
}
bool(false)
array(0) {}
int(6)
array(2) {
[0]=>
string(6) "foofoo"
[1]=>
string(3) "foo"
}
Actual result:
--------------
int(2)
array(2) {
[0]=>
string(2) "aa"
[1]=>
string(1) "a"
}
bool(false)
array(2) {
[0]=>
string(2) "aa"
[1]=>
string(1) "a"
}
int(6)
array(2) {
[0]=>
string(6) "foofoo"
[1]=>
string(3) "foo"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72711&edit=1