diff options
author | Rui Hirokawa <hirokawa@php.net> | 2005-12-23 11:15:16 +0000 |
---|---|---|
committer | Rui Hirokawa <hirokawa@php.net> | 2005-12-23 11:15:16 +0000 |
commit | cf90abfc247160877456bee56c97ad36bd9bef84 (patch) | |
tree | 83a0c37562183f8005b6d5d04f98050595ff6cfc /ext/mbstring/mbstring.c | |
parent | 35343ffaece4fe894977315871f539af98d33186 (diff) | |
download | php-git-cf90abfc247160877456bee56c97ad36bd9bef84.tar.gz |
MFH: fixed #28899 mb_substr() and substr() work differently when mbstring.func_overload is enabled.
Diffstat (limited to 'ext/mbstring/mbstring.c')
-rw-r--r-- | ext/mbstring/mbstring.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 7e665c37d4..c21c54a93a 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1763,6 +1763,11 @@ PHP_FUNCTION(mb_substr) } } + 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 */ |