hirokawa Fri Dec 23 11:14:54 2005 EDT Modified files: /php-src/ext/mbstring mbstring.c Log: fixed #28899 mb_substr() and substr() work differently when mbstring.func_overload is enabled. http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mbstring.c?r1=1.231&r2=1.232&diff_format=u Index: php-src/ext/mbstring/mbstring.c diff -u php-src/ext/mbstring/mbstring.c:1.231 php-src/ext/mbstring/mbstring.c:1.232 --- php-src/ext/mbstring/mbstring.c:1.231 Fri Dec 16 14:50:31 2005 +++ php-src/ext/mbstring/mbstring.c Fri Dec 23 11:14:54 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mbstring.c,v 1.231 2005/12/16 14:50:31 tony2001 Exp $ */ +/* $Id: mbstring.c,v 1.232 2005/12/23 11:14:54 hirokawa Exp $ */ /* * PHP 4 Multibyte String module "mbstring" @@ -60,7 +60,6 @@ #include "ext/standard/url.h" #include "main/php_output.h" #include "ext/standard/info.h" - #include "libmbfl/mbfl/mbfl_allocators.h" #include "php_variables.h" @@ -1763,6 +1762,11 @@ } } + if (((MBSTRG(func_overload) & MB_OVERLOAD_STRING) == MB_OVERLOAD_STRING) + && (from >= mbfl_strlen(&string))) { + RETURN_FALSE; + } + ret = mbfl_substr(&string, &result, from, len); if (ret != NULL) { RETVAL_STRINGL((char *)ret->val, ret->len, 0); /* the string is already strdup()'ed */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php