diff options
Diffstat (limited to 'ext/mbstring/php_unicode.c')
-rw-r--r-- | ext/mbstring/php_unicode.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c index 406069576e..2abad1330b 100644 --- a/ext/mbstring/php_unicode.c +++ b/ext/mbstring/php_unicode.c @@ -98,7 +98,6 @@ static int prop_lookup(unsigned long code, unsigned long n) } - MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1, unsigned long mask2) { @@ -277,6 +276,11 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s size_t i; enum mbfl_no_encoding _src_encoding = mbfl_name2no_encoding(src_encoding); + if (_src_encoding == mbfl_no_encoding_invalid) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", src_encoding); + return NULL; + } + unicode = php_mb_convert_encoding(srcstr, srclen, "UCS-4BE", src_encoding, &unicode_len TSRMLS_CC); if (unicode == NULL) return NULL; |