php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73322 mb_convert_variables detects recursive reference incorrectly
Submitted: 2016-10-14 14:48 UTC Modified: 2016-10-16 03:07 UTC
Votes:13
Avg. Score:4.7 ± 0.7
Reproduced:12 of 13 (92.3%)
Same Version:4 (33.3%)
Same OS:4 (33.3%)
From: townwear at gmail dot com Assigned: yohgaki
Status: Assigned Package: mbstring related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-10-14 14:48 UTC] townwear at gmail dot com
Description:
------------
PHP-7.0.11 is no problem.
$ php -r '$x = ["a", "b"]; mb_convert_variables("UTF-8", "SJIS,EUC-JP", $x);'
// no output


PHP-7.0.12 is problem.
$ php -r '$x = ["a", "b"]; mb_convert_variables("UTF-8", "SJIS,EUC-JP", $x);'
PHP Warning:  mb_convert_variables(): Cannot handle recursive references in Command line code on line 1

Warning: mb_convert_variables(): Cannot handle recursive references in Command line code on line 1

Test script:
---------------
$ php -r '$x = ["a", "b"]; mb_convert_variables("UTF-8", "SJIS,EUC-JP", $x);'

Expected result:
----------------
// no output

Actual result:
--------------
PHP Warning:  mb_convert_variables(): Cannot handle recursive references in Command line code on line 1

Warning: mb_convert_variables(): Cannot handle recursive references in Command line code on line 1

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-10-14 15:57 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: yohgaki
 [2016-10-14 15:57 UTC] cmb@php.net
Confirmed: <https://3v4l.org/IA2Cp#v7012>. The regression has
been introduced by fixing bug #66964.

Yasuo, can you please have a look at this issue.
 [2016-10-14 23:36 UTC] yohgaki@php.net
-Status: Verified +Status: Assigned -Operating System: CentOS7 +Operating System: Irrelevant -PHP Version: 7.0.12 +PHP Version: Irrelevant
 [2016-10-14 23:36 UTC] yohgaki@php.net
The code has obvious issue...
I'll fix it.
 [2016-10-15 01:07 UTC] yohgaki@php.net
-Summary: mb_convert_variables is problem +Summary: mb_convert_variables detects recursive reference incorrectly
 [2016-10-16 03:07 UTC] yohgaki@php.net
PR is made. PHP 5.6 has some issues also, but I would like to leave 5.6 as it is now.
 [2016-12-19 14:46 UTC] msangapu at microsoft dot com
Hello, we have customers on MS Azure using 5.6.28 and facing these warnings. I see from the comments that this will be fixed in PHP 7.x. Can you please pull this fix into 5.6.x branch as well?
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Thu Jul 27 18:01:37 2017 UTC