derick          Tue Aug 19 04:29:58 2003 EDT

  Added files:                 
    /php-src/ext/mbstring/tests bug25140.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/mbstring       mbstring.c 
  Log:
  - Fix for bug #25140 (mb_convert_encoding returns FALSE when it tries to
    convert empty string)
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1455 php-src/NEWS:1.1456
--- php-src/NEWS:1.1455 Mon Aug 18 21:47:15 2003
+++ php-src/NEWS        Tue Aug 19 04:29:55 2003
@@ -27,6 +27,8 @@
 - Fixed support for <![CDATA[]]> fields within XML documents in ext/xml. 
   (Sterling)
 - Fixed visibility of __construct and __clone. (Marcus)
+- Fixed bug #25140 (mb_convert_encoding returns FALSE when it tries to convert
+  empty string). (Derick)
 - Fixed bug #24729 ($obj = new $className; causes crash when $className is not 
   set). (Marcus)
 - Fixed bug #24565 (cannot read array elements recived via $_REQUEST). (Zeev)
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.187 php-src/ext/mbstring/mbstring.c:1.188
--- php-src/ext/mbstring/mbstring.c:1.187       Mon Aug 11 01:24:42 2003
+++ php-src/ext/mbstring/mbstring.c     Tue Aug 19 04:29:56 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: mbstring.c,v 1.187 2003/08/11 05:24:42 fujimoto Exp $ */
+/* $Id: mbstring.c,v 1.188 2003/08/19 08:29:56 derick Exp $ */
 
 /*
  * PHP4 Multibyte String module "mbstring"
@@ -2004,7 +2004,7 @@
        if (ret != NULL) {
                RETVAL_STRINGL(ret, size, 0);           /* the string is already 
strdup()'ed */
        } else {
-               RETVAL_FALSE;
+               RETVAL_STRINGL("", 0, 1);
        }
        if ( s_free) {
                efree(s_free);

Index: php-src/ext/mbstring/tests/bug25140.phpt
+++ php-src/ext/mbstring/tests/bug25140.phpt
--TEST--
Bug #25140 (mb_convert_encoding returns FALSE on an empty string)
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
var_dump( mb_convert_encoding( '', 'SJIS', 'EUC-JP' ) );
?>
--EXPECT--
string(0) ""



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to