summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_unicode.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-07-28 14:57:08 +0200
committerNikita Popov <nikita.ppv@gmail.com>2017-07-28 14:57:08 +0200
commitf4a1d9c8211fa7878af14d0bd94b2deaab19ae21 (patch)
treee57c195f4fed5627294a9cba1bc8e40f80d05eb4 /ext/mbstring/php_unicode.c
parent25b6e684326a064abfed75be1867b71f7d12a364 (diff)
downloadphp-git-f4a1d9c8211fa7878af14d0bd94b2deaab19ae21.tar.gz
Fixed bug #65544 and #71298
Diffstat (limited to 'ext/mbstring/php_unicode.c')
-rw-r--r--ext/mbstring/php_unicode.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c
index 1bd348b3d2..71541a8372 100644
--- a/ext/mbstring/php_unicode.c
+++ b/ext/mbstring/php_unicode.c
@@ -343,32 +343,24 @@ static int convert_case_filter(int c, void *void_data)
case PHP_UNICODE_CASE_TITLE_SIMPLE:
case PHP_UNICODE_CASE_TITLE:
{
- int res = php_unicode_is_prop(c,
- UC_MN, UC_ME, UC_CF, UC_LM, UC_SK, UC_LU, UC_LL, UC_LT, UC_PO, UC_OS, -1);
- out[0] = c;
- len = 1;
if (data->title_mode) {
- if (res) {
- if (data->case_mode == PHP_UNICODE_CASE_TITLE_SIMPLE) {
- out[0] = php_unicode_tolower_simple(c, data->no_encoding);
- len = 1;
- } else {
- len = php_unicode_tolower_full(c, data->no_encoding, out);
- }
+ if (data->case_mode == PHP_UNICODE_CASE_TITLE_SIMPLE) {
+ out[0] = php_unicode_tolower_simple(c, data->no_encoding);
+ len = 1;
} else {
- data->title_mode = 0;
+ len = php_unicode_tolower_full(c, data->no_encoding, out);
}
} else {
- if (res) {
- data->title_mode = 1;
- if (data->case_mode == PHP_UNICODE_CASE_TITLE_SIMPLE) {
- out[0] = php_unicode_totitle_simple(c, data->no_encoding);
- len = 1;
- } else {
- len = php_unicode_totitle_full(c, data->no_encoding, out);
- }
+ if (data->case_mode == PHP_UNICODE_CASE_TITLE_SIMPLE) {
+ out[0] = php_unicode_totitle_simple(c, data->no_encoding);
+ len = 1;
+ } else {
+ len = php_unicode_totitle_full(c, data->no_encoding, out);
}
}
+ if (!php_unicode_is_case_ignorable(c)) {
+ data->title_mode = php_unicode_is_cased(c);
+ }
break;
}
default: