]> granicus.if.org Git - php/commitdiff
- Fix bug #28466 (mbstring_convert_variables() problem).
authorMoriyoshi Koizumi <moriyoshi@php.net>
Sat, 26 Jun 2004 05:39:00 +0000 (05:39 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Sat, 26 Jun 2004 05:39:00 +0000 (05:39 +0000)
NEWS
ext/mbstring/mbstring.c
ext/mbstring/tests/bug26639.phpt

diff --git a/NEWS b/NEWS
index 72e2190a86c7f7f807fc482e5c563f9804efef29..0807c7bfccf8abb08c250f8f58a9ebfdefa4956f 100644 (file)
--- 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)
index ca43de4149ce6ea71397cadcf71a0b8d9af979dd..310f7b6112f8e4998a4b5e4d2e4d59f00815f8a6 100644 (file)
@@ -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);
index 651e6f45bed054bc84d5fe573c23eadf3a46b9c2..a87e912ba60d3268a03da6f52a5a54b2f0a6cd6b 100644 (file)
@@ -33,7 +33,7 @@ unset($c);
 $a = "\82 \82¢\82¤\82¦\82¨";
 $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 = "\82 \82¢\82¤\82¦\82¨";
 $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 = "\82 \82¢\82¤\82¦\82¨";
 $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("\82 \82¢\82¤\82¦\82¨"));
+$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) "\82 \82¢\82¤\82¦\82¨" refcount(1)
+  }
+}
+array(1) refcount(2){
+  [0]=>
+  array(1) refcount(1){
+    [0]=>
+    string(10) "¤¢¤¤¤¦¤¨¤ª" refcount(1)
+  }
+}