hirokawa Fri Dec 23 11:15:32 2005 EDT
Modified files: (Branch: PHP_5_0)
/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.214.2.7&r2=1.214.2.8&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.214.2.7
php-src/ext/mbstring/mbstring.c:1.214.2.8
--- php-src/ext/mbstring/mbstring.c:1.214.2.7 Fri Nov 25 22:18:45 2005
+++ php-src/ext/mbstring/mbstring.c Fri Dec 23 11:15:32 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.214.2.7 2005/11/25 22:18:45 hirokawa Exp $ */
+/* $Id: mbstring.c,v 1.214.2.8 2005/12/23 11:15:32 hirokawa Exp $ */
/*
* PHP 4 Multibyte String module "mbstring"
@@ -1736,6 +1736,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