com php-src: Fixed bug #69840 (iconv_substr() doesn 't work with UTF-16BE): ext/iconv/iconv.c
| From: | Kalle Sommer Nielsen | Date: | Wed, 17 Jun 2015 07:39:45 +0000 |
| Subject: | com php-src: Fixed bug #69840 (iconv_substr() doesn 't work with UTF-16BE): ext/iconv/iconv.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87308@lists.php.net to get a copy of this message | ||
Commit: ff9e290438afc4c9e3d69bc88e37fd56267fe898
Author: Kalle Sommer Nielsen <kalle@php.net> Wed, 17 Jun 2015 09:39:45 +0200
Parents: 3697f0221282831c846ff67054a1b03a833f50bd
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ff9e290438afc4c9e3d69bc88e37fd56267fe898
Log:
Fixed bug #69840 (iconv_substr() doesn't work with UTF-16BE)
Bugs:
https://bugs.php.net/69840
Changed paths:
M ext/iconv/iconv.c
Diff:
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 897185d..8fcc43d 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -2109,7 +2109,7 @@ PHP_FUNCTION(iconv_substr)
err = _php_iconv_substr(&retval, str->val, str->len, offset, length, charset);
_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
- if (err == PHP_ICONV_ERR_SUCCESS && str->val[0] != '\0' && retval.s
!= NULL) {
+ if (err == PHP_ICONV_ERR_SUCCESS && str->len > 0 && retval.s != NULL) {
RETURN_NEW_STR(retval.s);
}
smart_str_free(&retval);