From: Moriyoshi Koizumi Date: Sat, 26 Jun 2004 05:39:00 +0000 (+0000) Subject: - Fix bug #28466 (mbstring_convert_variables() problem). X-Git-Tag: php-5.0.0~125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b33f7ab6715a9842e507a9ed54f507c81b655e52;p=php - Fix bug #28466 (mbstring_convert_variables() problem). --- diff --git a/NEWS b/NEWS index 72e2190a86..0807c7bfcc 100644 --- a/NEWS +++ b/NEWS @@ -15,7 +15,8 @@ PHP NEWS - Fixed bug #28702 (SOAP does not parse WSDL service address correctly). (Dmitry) - Fixed bug #28699 (Reflection api bugs). (Marcus) - Fixed bug #28694 (ReflectionExtension::getFunctions() crashes PHP). (Marcus) - +- Fixed bug #28466 (mbstring_convert_variables() array separation problem). + (Moriyoshi) 7 Jun 2004, PHP 5 Release Candidate 3 - Moved the PDFLib extension to PECL. (Wez) - Added MySQL 4.1.2-alpha and 4.1.3-beta support to MySQLI extension. (Georg) diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index ca43de4149..310f7b6112 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -2614,6 +2614,7 @@ detect_end: stack[stack_level] = var; stack_level++; var = hash_entry; + SEPARATE_ZVAL(hash_entry); target_hash = HASH_OF(*var); if (target_hash != NULL) { zend_hash_internal_pointer_reset(target_hash); diff --git a/ext/mbstring/tests/bug26639.phpt b/ext/mbstring/tests/bug26639.phpt index 651e6f45be..a87e912ba6 100644 --- a/ext/mbstring/tests/bug26639.phpt +++ b/ext/mbstring/tests/bug26639.phpt @@ -33,7 +33,7 @@ unset($c); $a = "‚ ‚¢‚¤‚¦‚¨"; $b = array(&$a); $c = $b; -mb_convert_variables("euc-jp", "shift_jis", $c); +mb_convert_variables("EUC-JP", "Shift_JIS", $c); debug_zval_dump($b); debug_zval_dump($c); unset($a); @@ -43,7 +43,7 @@ unset($c); $a = "‚ ‚¢‚¤‚¦‚¨"; $b = array($a); $c = &$b; -mb_convert_variables("euc-jp", "shift_jis", $c); +mb_convert_variables("EUC-JP", "Shift_JIS", $c); debug_zval_dump($b); debug_zval_dump($c); unset($a); @@ -53,7 +53,17 @@ unset($c); $a = "‚ ‚¢‚¤‚¦‚¨"; $b = array(&$a); $c = &$b; -mb_convert_variables("euc-jp", "shift_jis", $c); +mb_convert_variables("EUC-JP", "Shift_JIS", $c); +debug_zval_dump($b); +debug_zval_dump($c); +unset($a); +unset($b); +unset($c); + +$a = array(array("‚ ‚¢‚¤‚¦‚¨")); +$b = $a; +$c = $b; +mb_convert_variables("EUC-JP", "Shift_JIS", $c); debug_zval_dump($b); debug_zval_dump($c); unset($a); @@ -97,4 +107,17 @@ array(1) refcount(1){ [0]=> string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(2) } - +array(1) refcount(3){ + [0]=> + array(1) refcount(1){ + [0]=> + string(10) "‚ ‚¢‚¤‚¦‚¨" refcount(1) + } +} +array(1) refcount(2){ + [0]=> + array(1) refcount(1){ + [0]=> + string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1) + } +}