hirokawa Fri Dec 23 11:15:16 2005 EDT
Modified files: (Branch: PHP_5_1)
/php-src/ext/mbstring mbstring.c
Log:
MFH: 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.224.2.8&r2=1.224.2.9&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.8
php-src/ext/mbstring/mbstring.c:1.224.2.9
--- php-src/ext/mbstring/mbstring.c:1.224.2.8 Thu Dec 15 03:36:53 2005
+++ php-src/ext/mbstring/mbstring.c Fri Dec 23 11:15:16 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.224.2.8 2005/12/15 03:36:53 iliaa Exp $ */
+/* $Id: mbstring.c,v 1.224.2.9 2005/12/23 11:15:16 hirokawa Exp $ */
/*
* PHP 4 Multibyte String module "mbstring"
@@ -1763,6 +1763,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