summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_unicode.c
diff options
context:
space:
mode:
authorRui Hirokawa <hirokawa@php.net>2008-02-17 02:01:41 +0000
committerRui Hirokawa <hirokawa@php.net>2008-02-17 02:01:41 +0000
commite2fa604b0a5e79c04c1d0a9ecaf43dab62007067 (patch)
treef2226fe881bab2fe1d5da28843915222c7946f12 /ext/mbstring/php_unicode.c
parentbd98b8a3e0e122fad9039db3e8452724c6123a8a (diff)
downloadphp-git-e2fa604b0a5e79c04c1d0a9ecaf43dab62007067.tar.gz
MF PHP5_3 (fixed #43998)
Diffstat (limited to 'ext/mbstring/php_unicode.c')
-rw-r--r--ext/mbstring/php_unicode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c
index ca30db73b2..d90cabb84d 100644
--- a/ext/mbstring/php_unicode.c
+++ b/ext/mbstring/php_unicode.c
@@ -276,6 +276,11 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, char *srcstr, size_t
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;