derick Tue Aug 19 04:34:52 2003 EDT
Added files: (Branch: PHP_4_3)
/php-src/ext/mbstring/tests bug25140.phpt
Modified files:
/php-src/ext/mbstring mbstring.c
Log:
- MFH: Fix for bug #25140 (mb_convert_encoding returns FALSE when it tries to
convert empty string)
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.142.2.24
php-src/ext/mbstring/mbstring.c:1.142.2.25
--- php-src/ext/mbstring/mbstring.c:1.142.2.24 Tue Aug 12 11:04:52 2003
+++ php-src/ext/mbstring/mbstring.c Tue Aug 19 04:34:51 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.142.2.24 2003/08/12 15:04:52 iliaa Exp $ */
+/* $Id: mbstring.c,v 1.142.2.25 2003/08/19 08:34:51 derick Exp $ */
/*
* PHP4 Multibyte String module "mbstring"
@@ -2625,7 +2625,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