[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS ext/mbstring/mbstring.c ext/mbstring/php_mbregex.c ext/mbstring/php_mbregex.h ext/mbstring/tests/mb_ereg_replace_callback.phpt
hirokawa Fri, 02 Mar 2012 14:19:05 + Revision: http://svn.php.net/viewvc?view=revision&revision=323820 Log: MFH mb_ereg_replace_callback() for security enhancements. Changed paths: U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c U php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c U php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.h A php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_ereg_replace_callback.phpt Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2012-03-02 14:16:47 UTC (rev 323819) +++ php/php-src/branches/PHP_5_4/NEWS 2012-03-02 14:19:05 UTC (rev 323820) @@ -46,6 +46,9 @@ - Zlib: . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikita Popov) +- mbstring: + . MFH mb_ereg_replace_callback() for security enhancements. (Rui) + 01 Mar 2012, PHP 5.4.0 - Installation: Modified: php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c 2012-03-02 14:16:47 UTC (rev 323819) +++ php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c 2012-03-02 14:19:05 UTC (rev 323820) @@ -467,6 +467,13 @@ ZEND_ARG_INFO(0, string) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_ereg_replace_callback, 0, 0, 3) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, callback) + ZEND_ARG_INFO(0, string) + ZEND_ARG_INFO(0, option) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_split, 0, 0, 2) ZEND_ARG_INFO(0, pattern) ZEND_ARG_INFO(0, string) Modified: php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c 2012-03-02 14:16:47 UTC (rev 323819) +++ php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c 2012-03-02 14:19:05 UTC (rev 323820) @@ -784,7 +784,7 @@ /* }}} */ /* {{{ _php_mb_regex_ereg_replace_exec */ -static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOptionType options) +static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOptionType options, int is_callable) { zval **arg_pattern_zval; @@ -794,6 +794,9 @@ char *replace; int replace_len; + zend_fcall_info arg_replace_fci; + zend_fcall_info_cache arg_replace_fci_cache; + char *string; int string_len; @@ -826,12 +829,22 @@ char *option_str = NULL; int option_str_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zss|s", - &arg_pattern_zval, - &replace, &replace_len, - &string, &string_len, - &option_str, &option_str_len) == FAILURE) { - RETURN_FALSE; + if (!is_callable) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zss|s", + &arg_pattern_zval, + &replace, &replace_len, + &string, &string_len, + &option_str, &option_str_len) == FAILURE) { +RETURN_FALSE; + } + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zfs|s", + &arg_pattern_zval, + &arg_replace_fci, &arg_replace_fci_cache, + &string, &string_len, + &option_str, &option_str_len) == FAILURE) { +RETURN_FALSE; + } } if (option_str != NULL) { @@ -859,7 +872,7 @@ RETURN_FALSE; } - if (eval) { + if (eval || is_callable) { pbuf = &eval_buf; description = zend_make_compiled_string_description("mbregex replace" TSRMLS_CC); } else { @@ -867,6 +880,13 @@ description = NULL; } + if (is_callable) { + if (eval) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option 'e' cannot be used with replacement callback"); + RETURN_FALSE; + } + } + /* do the actual work */ err = 0; pos = (OnigUChar *)string; @@ -889,28 +909,32 @@ #endif /* copy the part of the string before the match */ smart_str_appendl(&out_buf, pos, (size_t)((OnigUChar *)(string + regs->beg[0]) - pos)); - /* copy replacement and backrefs */ - i = 0; - p = replace; - while (i < replace_len) { -int fwd = (int) php_mb_mbchar_bytes_ex(p, enc); -n = -1; -if ((replace_len - i) >= 2 && fwd == 1 && + + if (!is_callable) { +/* copy replacement and backrefs */ +i = 0; +p = replace; +while (i < replace_len) { + int fwd = (int) php_mb_mbchar_bytes_ex(p, enc); + n = -1; + if ((replace_len - i) >= 2 && fwd == 1 && p[0] == '\\' && p[1] >= '0' && p[1] <= '9') { - n = p[1] - '0'; -} -if (n >= 0 && n < regs->num_regs) { - if (regs->beg[n] >= 0 && regs->beg[n] < regs->end[n] && regs->end[n] <= string_len) { - smart_str_appendl(pbuf, string + regs->beg[n], regs->end[n] - regs->beg[n]); + n = p[1] - '0'; } - p += 2; - i += 2; -} else { - smart_str_appendl(pbuf, p, fwd); - p += fwd; - i += fwd; + if (n >= 0 && n <
[PHP-CVS] com php-src: fixed a mistake on reverting my previous patch: http://git.php.net/?p=php-src.git;a=commitdiff;h=50b2e02c045b61f99e8c72d54e6bec055aee98e4: ext/standard/exec.c
Commit:b28231165a8eef2fcbdbc41d6abc4d0d46155172 Author:Rui Hirokawa Mon, 9 Apr 2012 23:32:41 +0900 Parents: 8ac56c15c98f27ac097fe53ac3bdf91a543eaed2 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b28231165a8eef2fcbdbc41d6abc4d0d46155172 Log: fixed a mistake on reverting my previous patch: http://git.php.net/?p=php-src.git;a=commitdiff;h=50b2e02c045b61f99e8c72d54e6bec055aee98e4 Changed paths: M ext/standard/exec.c Diff: diff --git a/ext/standard/exec.c b/ext/standard/exec.c index b0ccdec..a5ca84b 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -272,8 +272,8 @@ PHPAPI char *php_escape_shell_cmd(char *str) p = NULL; } else { cmd[y++] = '\\'; - cmd[y++] = str[x]; } + cmd[y++] = str[x]; break; #else /* % is Windows specific for enviromental variables, ^%PATH% will -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: MFH: fixed a mistake on reverting my previous patch.: ext/standard/exec.c
Commit:882dca647a42c974102cfd1c75818764a18f Author:Rui Hirokawa Mon, 9 Apr 2012 23:49:18 +0900 Parents: 7ae93a2c4c8a51cc2aec9977ce3c83c100e382a0 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=882dca647a42c974102cfd1c75818764a18f Log: MFH: fixed a mistake on reverting my previous patch. Changed paths: M ext/standard/exec.c Diff: diff --git a/ext/standard/exec.c b/ext/standard/exec.c index b0ccdec..a5ca84b 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -272,8 +272,8 @@ PHPAPI char *php_escape_shell_cmd(char *str) p = NULL; } else { cmd[y++] = '\\'; - cmd[y++] = str[x]; } + cmd[y++] = str[x]; break; #else /* % is Windows specific for enviromental variables, ^%PATH% will -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fixed #65045: mb_convert_encoding breaks well-formed character.: ext/mbstring/libmbfl/filters/mbfilter_utf8.c ext/mbstring/libmbfl/filters/mbfilter_utf8.h ext/mbstring/libmbfl/f
Commit:c6a7549efcca62346687b0fda5b408b963f5ab2d Author:Rui Hirokawa Sun, 30 Jun 2013 15:30:45 +0900 Parents: 4d606cf01e5b376cac1ac336f3e54ef480033028 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c6a7549efcca62346687b0fda5b408b963f5ab2d Log: fixed #65045: mb_convert_encoding breaks well-formed character. Bugs: https://bugs.php.net/65045 Changed paths: M ext/mbstring/libmbfl/filters/mbfilter_utf8.c M ext/mbstring/libmbfl/filters/mbfilter_utf8.h M ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c index fcee610..5539700 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c @@ -79,7 +79,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_wchar, - mbfl_filt_conv_common_flush + mbfl_filt_conv_utf8_wchar_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8 = { @@ -93,6 +93,17 @@ const struct mbfl_convert_vtbl vtbl_wchar_utf8 = { #define CK(statement) do { if ((statement) < 0) return (-1); } while (0) +int mbfl_filt_put_invalid_char(int c, mbfl_convert_filter *filter) +{ + int w; + w = c & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + filter->status = 0; + filter->cache = 0; + CK((*filter->output_function)(w, filter->data)); +} + + /* * UTF-8 => wchar */ @@ -100,111 +111,104 @@ int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter) { int s, c1, w = 0, flag = 0; - if (c < 0x80) { - if (filter->status != 0) { - w = (filter->cache & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - filter->status = 0; - filter->cache = 0; - } - if (c >= 0) { +retry: + switch (filter->status & 0xff) { + case 0x00: + if (c < 0x80) { CK((*filter->output_function)(c, filter->data)); + } else if (c >= 0xc2 && c <= 0xdf) { /* 2byte code first char: 0xc2-0xdf */ + filter->status = 0x10; + filter->cache = c & 0x1f; + } else if (c >= 0xe0 && c <= 0xef) { /* 3byte code first char: 0xe0-0xef */ + filter->status = 0x20; + filter->cache = c & 0xf; + } else if (c >= 0xf0 && c <= 0xf4) { /* 3byte code first char: 0xf0-0xf4 */ + filter->status = 0x30; + filter->cache = c & 0x7; + } else { + mbfl_filt_put_invalid_char(c, filter); } - } else if (c < 0xc0) { - int status = filter->status & 0xff; - switch (status) { - case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ - case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ - case 0x32: /* 4byte code 4th char: 0x80-0xbf */ - filter->status = 0; - s = filter->cache | (c & 0x3f); + break; + case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ + case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ + case 0x32: /* 4byte code 4th char: 0x80-0xbf */ + filter->status = 0; + if (c >= 0x80 && c <= 0xbf) { + s = (filter->cache<<6) | (c & 0x3f); filter->cache = 0; - if ((status == 0x10 && s >= 0x80) || - (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x1 && s < 0x11)) { - CK((*filter->output_function)(s, filter->data)); - } else { - w = s & MBFL_WCSGROUP_MASK; - flag = 1; - } - break; - case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ - s = filter->cache | ((c & 0x3f) << 6); - c1 = (s >> 12) & 0xf; - if ((c1 == 0x0 && c >= 0xa0) || - (c1 == 0xd && c < 0xa0) || - (c1 > 0x0 && c1 != 0xd)) { - filter->cache = s; -
[PHP-CVS] com php-src: added test code for #65045.: ext/mbstring/tests/bug65045.phpt
Commit:1db66942e1c2e16b36ee614d827605b9fd9b611f Author:Rui Hirokawa Sun, 30 Jun 2013 15:31:36 +0900 Parents: c6a7549efcca62346687b0fda5b408b963f5ab2d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1db66942e1c2e16b36ee614d827605b9fd9b611f Log: added test code for #65045. Bugs: https://bugs.php.net/65045 Changed paths: A ext/mbstring/tests/bug65045.phpt Diff: diff --git a/ext/mbstring/tests/bug65045.phpt b/ext/mbstring/tests/bug65045.phpt new file mode 100644 index 000..03a090d --- /dev/null +++ b/ext/mbstring/tests/bug65045.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #65045: mb_convert_encoding breaks well-formed character +--SKIPIF-- + +--FILE-- +http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: updated test script for bug #65045.: ext/mbstring/tests/illformed_utf_sequences.phpt
Commit:cb607d4f7862f2c9735e48524c4ae2e499698e8c Author:Rui Hirokawa Sun, 21 Jul 2013 10:18:33 +0900 Parents: 7daf1a6c1473e4d5f414256c02944527f2ec3c63 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cb607d4f7862f2c9735e48524c4ae2e499698e8c Log: updated test script for bug #65045. Bugs: https://bugs.php.net/65045 Changed paths: M ext/mbstring/tests/illformed_utf_sequences.phpt Diff: diff --git a/ext/mbstring/tests/illformed_utf_sequences.phpt b/ext/mbstring/tests/illformed_utf_sequences.phpt index b5b9d94..378b956 100644 --- a/ext/mbstring/tests/illformed_utf_sequences.phpt +++ b/ext/mbstring/tests/illformed_utf_sequences.phpt @@ -25,28 +25,28 @@ var_dump(chk_enc("\x31\x32\x33", 0)); var_dump(chk_enc("\x41\x42\x43", 0)); var_dump(chk_enc("\xc0\xb1\xc0\xb2\xc0\xb3", 6)); var_dump(chk_enc("\xc1\x81\xc1\x82\xc1\x83", 6)); -var_dump(chk_enc("\xe0\x80\xb1\xe0\x80\xb2\xe0\x80\xb3", 6)); -var_dump(chk_enc("\xe0\x81\x81\xe0\x81\x82\xe0\x81\x83", 6)); -var_dump(chk_enc("\xf0\x80\x80\xb1\xf0\x80\x80\xb2\xf0\x80\x80\xb3", 9)); -var_dump(chk_enc("\xf0\x80\x81\x81\xf0\x80\x81\x82\xf0\x81\x83", 8)); +var_dump(chk_enc("\xe0\x80\xb1\xe0\x80\xb2\xe0\x80\xb3", 9)); +var_dump(chk_enc("\xe0\x81\x81\xe0\x81\x82\xe0\x81\x83", 9)); +var_dump(chk_enc("\xf0\x80\x80\xb1\xf0\x80\x80\xb2\xf0\x80\x80\xb3", 12)); +var_dump(chk_enc("\xf0\x80\x81\x81\xf0\x80\x81\x82\xf0\x81\x83", 11)); var_dump(chk_enc("\xf8\x80\x80\x80\xb1\xf8\x80\x80\x80\xb2\xf8\x80\x80\x80\xb3", 15)); var_dump(chk_enc("\xf8\x80\x80\x81\x81\xf8\x80\x80\x81\x82\xf8\x80\x80\x81\x83", 15)); var_dump(chk_enc("\xfc\x80\x80\x80\x80\xb1\xfc\x80\x80\x80\x80\xb2\xfc\x80\x80\x80\x80\xb3", 18)); var_dump(chk_enc("\xfc\x80\x80\x80\x81\x81\xfc\x80\x80\x80\x81\x82\xfc\x80\x80\x80\x81\x83", 18)); var_dump(chk_enc("\xc2\xa2\xc2\xa3\xc2\xa5", 0)); -var_dump(chk_enc("\xe0\x82\xa2\xe0\x82\xa3\xe0\x82\xa5", 6)); -var_dump(chk_enc("\xf0\x80\x82\xa2\xf0\x80\x82\xa3\xf0\x80\x82\xa5", 9)); +var_dump(chk_enc("\xe0\x82\xa2\xe0\x82\xa3\xe0\x82\xa5", 9)); +var_dump(chk_enc("\xf0\x80\x82\xa2\xf0\x80\x82\xa3\xf0\x80\x82\xa5", 12)); var_dump(chk_enc("\xf8\x80\x80\x82\xa2\xf8\x80\x80\x82\xa3\xf8\x80\x80\x82\xa5", 15)); var_dump(chk_enc("\xfc\x80\x80\x80\x82\xa2\xfc\x80\x80\x80\x82\xa3\xfc\x80\x80\x80\x82\xa5", 18)); var_dump(chk_enc("\xc1\xbf", 2)); var_dump(chk_enc("\xc2\x80", 0)); var_dump(chk_enc("\xdf\xbf", 0)); -var_dump(chk_enc("\xe0\x9f\xff", 2)); +var_dump(chk_enc("\xe0\x9f\xff", 3)); var_dump(chk_enc("\xe0\xa0\x80", 2)); var_dump(chk_enc("\xef\xbf\xbf", 0)); -var_dump(chk_enc("\xf0\x8f\xbf\xbf", 3)); +var_dump(chk_enc("\xf0\x8f\xbf\xbf", 4)); var_dump(chk_enc("\xf0\x90\x80\x80", 0)); var_dump(chk_enc("\xf7\xbf\xbf\xbf", 4)); var_dump(chk_enc("\xf8\x87\xbf\xbf\xbf", 5)); @@ -61,7 +61,7 @@ echo "UTF-8 and surrogates area\n"; $out = ''; $cnt = 0; for ($i = 0xd7ff; $i <= 0xe000; ++$i) { - $s = chk_enc(pack('C3', 0xe0 | ($i >> 12), 0x80 | ($i >> 6) & 0x3f, 0x80 | $i & 0x3f), 2); + $s = chk_enc(pack('C3', 0xe0 | ($i >> 12), 0x80 | ($i >> 6) & 0x3f, 0x80 | $i & 0x3f), 3); if ($s === false) { $cnt++; } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: fixed #65045: mb_convert_encoding breakswell-formed character.: ext/mbstring/libmbfl/filters/mbfilter_utf8.cext/mbstring/libmbfl/filters/mbfilter_utf8.h ext/mbstring/libmbfl
Hi, Sorry, I forgot to push the test script. Now, I hope that it works fine. Rui Laruence wrote: Hey: I got one test script failed now: ext/mbstring/tests/illformed_utf_sequences.phpt diff is attached.. thanks On Sun, Jun 30, 2013 at 2:30 PM, Rui Hirokawa wrote: Commit:c6a7549efcca62346687b0fda5b408b963f5ab2d Author:Rui Hirokawa Sun, 30 Jun 2013 15:30:45 +0900 Parents: 4d606cf01e5b376cac1ac336f3e54ef480033028 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c6a7549efcca62346687b0fda5b408b963f5ab2d Log: fixed #65045: mb_convert_encoding breaks well-formed character. Bugs: https://bugs.php.net/65045 Changed paths: M ext/mbstring/libmbfl/filters/mbfilter_utf8.c M ext/mbstring/libmbfl/filters/mbfilter_utf8.h M ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: MFH: fixed #65045: mb_convert_encoding breaks well-formed character.: ext/mbstring/libmbfl/filters/mbfilter_utf8.c ext/mbstring/libmbfl/filters/mbfilter_utf8.h ext/mbstring/libm
Commit:c10d7e1afc63f0a0eaadb115560cc3ca626eb245 Author:Rui Hirokawa Wed, 31 Jul 2013 08:17:15 +0900 Parents: 8ca04e51aa9c420b7fea6e8dddb78ae5b84a71c0 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c10d7e1afc63f0a0eaadb115560cc3ca626eb245 Log: MFH: fixed #65045: mb_convert_encoding breaks well-formed character. Bugs: https://bugs.php.net/65045 Changed paths: M ext/mbstring/libmbfl/filters/mbfilter_utf8.c M ext/mbstring/libmbfl/filters/mbfilter_utf8.h M ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c M ext/mbstring/tests/illformed_utf_sequences.phpt diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c index fcee610..5539700 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c @@ -79,7 +79,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_wchar, - mbfl_filt_conv_common_flush + mbfl_filt_conv_utf8_wchar_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8 = { @@ -93,6 +93,17 @@ const struct mbfl_convert_vtbl vtbl_wchar_utf8 = { #define CK(statement) do { if ((statement) < 0) return (-1); } while (0) +int mbfl_filt_put_invalid_char(int c, mbfl_convert_filter *filter) +{ + int w; + w = c & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + filter->status = 0; + filter->cache = 0; + CK((*filter->output_function)(w, filter->data)); +} + + /* * UTF-8 => wchar */ @@ -100,111 +111,104 @@ int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter) { int s, c1, w = 0, flag = 0; - if (c < 0x80) { - if (filter->status != 0) { - w = (filter->cache & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - filter->status = 0; - filter->cache = 0; - } - if (c >= 0) { +retry: + switch (filter->status & 0xff) { + case 0x00: + if (c < 0x80) { CK((*filter->output_function)(c, filter->data)); + } else if (c >= 0xc2 && c <= 0xdf) { /* 2byte code first char: 0xc2-0xdf */ + filter->status = 0x10; + filter->cache = c & 0x1f; + } else if (c >= 0xe0 && c <= 0xef) { /* 3byte code first char: 0xe0-0xef */ + filter->status = 0x20; + filter->cache = c & 0xf; + } else if (c >= 0xf0 && c <= 0xf4) { /* 3byte code first char: 0xf0-0xf4 */ + filter->status = 0x30; + filter->cache = c & 0x7; + } else { + mbfl_filt_put_invalid_char(c, filter); } - } else if (c < 0xc0) { - int status = filter->status & 0xff; - switch (status) { - case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ - case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ - case 0x32: /* 4byte code 4th char: 0x80-0xbf */ - filter->status = 0; - s = filter->cache | (c & 0x3f); + break; + case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ + case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ + case 0x32: /* 4byte code 4th char: 0x80-0xbf */ + filter->status = 0; + if (c >= 0x80 && c <= 0xbf) { + s = (filter->cache<<6) | (c & 0x3f); filter->cache = 0; - if ((status == 0x10 && s >= 0x80) || - (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x1 && s < 0x11)) { - CK((*filter->output_function)(s, filter->data)); - } else { - w = s & MBFL_WCSGROUP_MASK; - flag = 1; - } - break; - case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ - s = filter->cache | ((c & 0x3f) << 6); - c1 = (s >> 12) & 0xf; - if ((c1 == 0x0 && c >= 0xa0) || - (c1 == 0xd && c < 0xa0) || - (c1 > 0x0 && c1 != 0xd)) { -
[PHP-CVS] com php-src: added test script for bug65045.: ext/mbstring/tests/bug65045.phpt
Commit:7da331501545c36088b535be0c53580a268ee5f4 Author:Rui Hirokawa Wed, 31 Jul 2013 08:18:39 +0900 Parents: c10d7e1afc63f0a0eaadb115560cc3ca626eb245 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7da331501545c36088b535be0c53580a268ee5f4 Log: added test script for bug65045. Bugs: https://bugs.php.net/65045 Changed paths: A ext/mbstring/tests/bug65045.phpt Diff: diff --git a/ext/mbstring/tests/bug65045.phpt b/ext/mbstring/tests/bug65045.phpt new file mode 100644 index 000..03a090d --- /dev/null +++ b/ext/mbstring/tests/bug65045.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #65045: mb_convert_encoding breaks well-formed character +--SKIPIF-- + +--FILE-- +http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: MFH: fixed #65045: mb_convert_encoding breaks well-formed character.: ext/mbstring/libmbfl/filters/mbfilter_utf8.c ext/mbstring/libmbfl/filters/mbfilter_utf8.h ext/mbstring/libm
Commit:0a974f14d13832838dcc7bae88b3271b7d035f46 Author:Rui Hirokawa Wed, 31 Jul 2013 08:46:54 +0900 Parents: 1d7b6970f20a059c501e68927c9fb874bdb226bc Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0a974f14d13832838dcc7bae88b3271b7d035f46 Log: MFH: fixed #65045: mb_convert_encoding breaks well-formed character. Bugs: https://bugs.php.net/65045 Changed paths: M ext/mbstring/libmbfl/filters/mbfilter_utf8.c M ext/mbstring/libmbfl/filters/mbfilter_utf8.h M ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c A ext/mbstring/tests/bug65045.phpt M ext/mbstring/tests/illformed_utf_sequences.phpt diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c index fcee610..5539700 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c @@ -79,7 +79,7 @@ const struct mbfl_convert_vtbl vtbl_utf8_wchar = { mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_utf8_wchar, - mbfl_filt_conv_common_flush + mbfl_filt_conv_utf8_wchar_flush }; const struct mbfl_convert_vtbl vtbl_wchar_utf8 = { @@ -93,6 +93,17 @@ const struct mbfl_convert_vtbl vtbl_wchar_utf8 = { #define CK(statement) do { if ((statement) < 0) return (-1); } while (0) +int mbfl_filt_put_invalid_char(int c, mbfl_convert_filter *filter) +{ + int w; + w = c & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + filter->status = 0; + filter->cache = 0; + CK((*filter->output_function)(w, filter->data)); +} + + /* * UTF-8 => wchar */ @@ -100,111 +111,104 @@ int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter) { int s, c1, w = 0, flag = 0; - if (c < 0x80) { - if (filter->status != 0) { - w = (filter->cache & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - filter->status = 0; - filter->cache = 0; - } - if (c >= 0) { +retry: + switch (filter->status & 0xff) { + case 0x00: + if (c < 0x80) { CK((*filter->output_function)(c, filter->data)); + } else if (c >= 0xc2 && c <= 0xdf) { /* 2byte code first char: 0xc2-0xdf */ + filter->status = 0x10; + filter->cache = c & 0x1f; + } else if (c >= 0xe0 && c <= 0xef) { /* 3byte code first char: 0xe0-0xef */ + filter->status = 0x20; + filter->cache = c & 0xf; + } else if (c >= 0xf0 && c <= 0xf4) { /* 3byte code first char: 0xf0-0xf4 */ + filter->status = 0x30; + filter->cache = c & 0x7; + } else { + mbfl_filt_put_invalid_char(c, filter); } - } else if (c < 0xc0) { - int status = filter->status & 0xff; - switch (status) { - case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ - case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ - case 0x32: /* 4byte code 4th char: 0x80-0xbf */ - filter->status = 0; - s = filter->cache | (c & 0x3f); + break; + case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ + case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ + case 0x32: /* 4byte code 4th char: 0x80-0xbf */ + filter->status = 0; + if (c >= 0x80 && c <= 0xbf) { + s = (filter->cache<<6) | (c & 0x3f); filter->cache = 0; - if ((status == 0x10 && s >= 0x80) || - (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x1 && s < 0x11)) { - CK((*filter->output_function)(s, filter->data)); - } else { - w = s & MBFL_WCSGROUP_MASK; - flag = 1; - } - break; - case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ - s = filter->cache | ((c & 0x3f) << 6); - c1 = (s >> 12) & 0xf; - if ((c1 == 0x0 && c >= 0xa0) || - (c1 == 0xd && c <
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ mbstring.c
hirokawa Mon, 20 Dec 2010 14:38:08 + Revision: http://svn.php.net/viewvc?view=revision&revision=306509 Log: fixed compile error with VS2008. Changed paths: U php/php-src/trunk/ext/mbstring/mbstring.c Modified: php/php-src/trunk/ext/mbstring/mbstring.c === --- php/php-src/trunk/ext/mbstring/mbstring.c 2010-12-20 14:29:40 UTC (rev 306508) +++ php/php-src/trunk/ext/mbstring/mbstring.c 2010-12-20 14:38:08 UTC (rev 306509) @@ -1733,10 +1733,10 @@ case 'I': case 'i': { - array_init(return_value); const mbfl_encoding **entry = MBSTRG(http_input_list); const size_t n = MBSTRG(http_input_list_size); size_t i; + array_init(return_value); for (i = 0; i < n; i++) { add_next_index_string(return_value, (*entry)->name, 1); entry++; @@ -4468,9 +4468,9 @@ memcpy(entry, MBSTRG(detect_order_list), sizeof(mbfl_encoding*) * nentries); } else { const enum mbfl_no_encoding *src = MBSTRG(default_detect_order_list); + size_t i; nentries = MBSTRG(default_detect_order_list_size); entry = (const mbfl_encoding **)safe_emalloc(nentries, sizeof(mbfl_encoding*), 0); - size_t i; for (i = 0; i < nentries; i++) { entry[i] = mbfl_no2encoding(src[i]); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ basic_functions.c http.c php_http.h url.h
hirokawa Sat, 08 Jan 2011 02:21:44 + Revision: http://svn.php.net/viewvc?view=revision&revision=307247 Log: added an option to http_build_query for RFC-3986 based url-encoding. Changed paths: U php/php-src/trunk/ext/standard/basic_functions.c U php/php-src/trunk/ext/standard/http.c U php/php-src/trunk/ext/standard/php_http.h U php/php-src/trunk/ext/standard/url.h Modified: php/php-src/trunk/ext/standard/basic_functions.c === --- php/php-src/trunk/ext/standard/basic_functions.c2011-01-07 23:36:17 UTC (rev 307246) +++ php/php-src/trunk/ext/standard/basic_functions.c2011-01-08 02:21:44 UTC (rev 307247) @@ -1513,6 +1513,7 @@ ZEND_ARG_INFO(0, formdata) ZEND_ARG_INFO(0, prefix) ZEND_ARG_INFO(0, arg_separator) + ZEND_ARG_INFO(0, enc_type) ZEND_END_ARG_INFO() /* }}} */ /* {{{ image.c */ @@ -3531,6 +3532,8 @@ REGISTER_LONG_CONSTANT("PHP_URL_PATH", PHP_URL_PATH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PHP_URL_QUERY", PHP_URL_QUERY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PHP_URL_FRAGMENT", PHP_URL_FRAGMENT, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_QUERY_RFC1738", PHP_QUERY_RFC1738, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_QUERY_RFC3986", PHP_QUERY_RFC3986, CONST_CS | CONST_PERSISTENT); #define REGISTER_MATH_CONSTANT(x) REGISTER_DOUBLE_CONSTANT(#x, x, CONST_CS | CONST_PERSISTENT) REGISTER_MATH_CONSTANT(M_E); Modified: php/php-src/trunk/ext/standard/http.c === --- php/php-src/trunk/ext/standard/http.c 2011-01-07 23:36:17 UTC (rev 307246) +++ php/php-src/trunk/ext/standard/http.c 2011-01-08 02:21:44 UTC (rev 307247) @@ -29,7 +29,7 @@ const char *num_prefix, int num_prefix_len, const char *key_prefix, int key_prefix_len, const char *key_suffix, int key_suffix_len, - zval *type, char *arg_sep TSRMLS_DC) + zval *type, char *arg_sep, int enc_type TSRMLS_DC) { char *key = NULL, *ekey, *newprefix, *p; int arg_sep_len, key_len, ekey_len, key_type, newprefix_len; @@ -81,7 +81,11 @@ } if (Z_TYPE_PP(zdata) == IS_ARRAY || Z_TYPE_PP(zdata) == IS_OBJECT) { if (key_type == HASH_KEY_IS_STRING) { - ekey = php_url_encode(key, key_len, &ekey_len); + if (enc_type == PHP_QUERY_RFC3986) { + ekey = php_raw_url_encode(key, key_len, &ekey_len); + } else { + ekey = php_url_encode(key, key_len, &ekey_len); + } newprefix_len = key_suffix_len + ekey_len + key_prefix_len + 3 /* %5B */; newprefix = emalloc(newprefix_len + 1); p = newprefix; @@ -132,7 +136,7 @@ *p = '\0'; } ht->nApplyCount++; - php_url_encode_hash_ex(HASH_OF(*zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_PP(zdata) == IS_OBJECT ? *zdata : NULL), arg_sep TSRMLS_CC); + php_url_encode_hash_ex(HASH_OF(*zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_PP(zdata) == IS_OBJECT ? *zdata : NULL), arg_sep, enc_type TSRMLS_CC); ht->nApplyCount--; efree(newprefix); } else if (Z_TYPE_PP(zdata) == IS_NULL || Z_TYPE_PP(zdata) == IS_RESOURCE) { @@ -145,7 +149,11 @@ /* Simple key=value */ smart_str_appendl(formstr, key_prefix, key_prefix_len); if (key_type == HASH_KEY_IS_STRING) { - ekey = php_url_encode(key, key_len, &ekey_len); + if (enc_type == PHP_QUERY_RFC3986) { + ekey = php_raw_url_encode(key, key_len, &ekey_len); + } else { + ekey = php_url_encode(key, key_len, &ekey_len); + } smart_str_appendl(formstr, ekey, ekey_len); efree(ekey); } else { @@ -161,7 +169,11 @@ smart_str_appendl(formstr, "=", 1); switch (Z_TYPE_PP(zdata)) { case IS_STRING: - ekey = php_url_encode(Z_STRVAL_PP(zdata), Z_STRLEN_PP(zdata), &ekey_len); +
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/standard/ basic_functions.c http.c php_http.h url.h
hirokawa Sat, 08 Jan 2011 02:34:33 + Revision: http://svn.php.net/viewvc?view=revision&revision=307248 Log: MFH: added an option to http_build_query for RFC-3986 based url-encoding. Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c U php/php-src/branches/PHP_5_3/ext/standard/http.c U php/php-src/branches/PHP_5_3/ext/standard/php_http.h U php/php-src/branches/PHP_5_3/ext/standard/url.h Modified: php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c === --- php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2011-01-08 02:21:44 UTC (rev 307247) +++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2011-01-08 02:34:33 UTC (rev 307248) @@ -1516,6 +1516,7 @@ ZEND_ARG_INFO(0, formdata) ZEND_ARG_INFO(0, prefix) ZEND_ARG_INFO(0, arg_separator) + ZEND_ARG_INFO(0, enc_type) ZEND_END_ARG_INFO() /* }}} */ /* {{{ image.c */ @@ -3575,6 +3576,8 @@ REGISTER_LONG_CONSTANT("PHP_URL_PATH", PHP_URL_PATH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PHP_URL_QUERY", PHP_URL_QUERY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PHP_URL_FRAGMENT", PHP_URL_FRAGMENT, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_QUERY_RFC1738", PHP_QUERY_RFC1738, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHP_QUERY_RFC3986", PHP_QUERY_RFC3986, CONST_CS | CONST_PERSISTENT); #define REGISTER_MATH_CONSTANT(x) REGISTER_DOUBLE_CONSTANT(#x, x, CONST_CS | CONST_PERSISTENT) REGISTER_MATH_CONSTANT(M_E); Modified: php/php-src/branches/PHP_5_3/ext/standard/http.c === --- php/php-src/branches/PHP_5_3/ext/standard/http.c2011-01-08 02:21:44 UTC (rev 307247) +++ php/php-src/branches/PHP_5_3/ext/standard/http.c2011-01-08 02:34:33 UTC (rev 307248) @@ -29,7 +29,7 @@ const char *num_prefix, int num_prefix_len, const char *key_prefix, int key_prefix_len, const char *key_suffix, int key_suffix_len, - zval *type, char *arg_sep TSRMLS_DC) + zval *type, char *arg_sep, int enc_type TSRMLS_DC) { char *key = NULL, *ekey, *newprefix, *p; int arg_sep_len, key_len, ekey_len, key_type, newprefix_len; @@ -81,7 +81,11 @@ } if (Z_TYPE_PP(zdata) == IS_ARRAY || Z_TYPE_PP(zdata) == IS_OBJECT) { if (key_type == HASH_KEY_IS_STRING) { - ekey = php_url_encode(key, key_len, &ekey_len); + if (enc_type == PHP_QUERY_RFC3986) { + ekey = php_raw_url_encode(key, key_len, &ekey_len); + } else { + ekey = php_url_encode(key, key_len, &ekey_len); + } newprefix_len = key_suffix_len + ekey_len + key_prefix_len + 3 /* %5B */; newprefix = emalloc(newprefix_len + 1); p = newprefix; @@ -132,7 +136,7 @@ *p = '\0'; } ht->nApplyCount++; - php_url_encode_hash_ex(HASH_OF(*zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_PP(zdata) == IS_OBJECT ? *zdata : NULL), arg_sep TSRMLS_CC); + php_url_encode_hash_ex(HASH_OF(*zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_PP(zdata) == IS_OBJECT ? *zdata : NULL), arg_sep, enc_type TSRMLS_CC); ht->nApplyCount--; efree(newprefix); } else if (Z_TYPE_PP(zdata) == IS_NULL || Z_TYPE_PP(zdata) == IS_RESOURCE) { @@ -145,7 +149,11 @@ /* Simple key=value */ smart_str_appendl(formstr, key_prefix, key_prefix_len); if (key_type == HASH_KEY_IS_STRING) { - ekey = php_url_encode(key, key_len, &ekey_len); + if (enc_type == PHP_QUERY_RFC3986) { + ekey = php_raw_url_encode(key, key_len, &ekey_len); + } else { + ekey = php_url_encode(key, key_len, &ekey_len); + } smart_str_appendl(formstr, ekey, ekey_len); efree(ekey); } else { @@ -161,7 +169,11 @@ smart_str_appendl(formstr, "=", 1); switch (Z_TYPE_PP(zdata)) { case IS_STRING: -
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ libmbfl/mbfl/mbfilter.c mbstring.c
hirokawa Mon, 18 Jul 2011 08:21:48 + Revision: http://svn.php.net/viewvc?view=revision&revision=313365 Log: added numeric entities encode/decode in hex format. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.c U php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.c 2011-07-18 07:55:03 UTC (rev 313364) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.c 2011-07-18 08:21:48 UTC (rev 313365) @@ -2746,7 +2746,9 @@ } break; case 2: - if (c >= 0x30 && c <= 0x39) { /* '0' - '9' */ + if (c == 0x78) {/* 'x' */ + pc->status = 4; + } else if (c >= 0x30 && c <= 0x39) { /* '0' - '9' */ pc->cache = c - 0x30; pc->status = 3; pc->digit = 1; @@ -2810,6 +2812,89 @@ (*pc->decoder->filter_function)(c, pc->decoder); } break; + case 4: + if (c >= 0x30 && c <= 0x39) { /* '0' - '9' */ + pc->cache = c - 0x30; + pc->status = 5; + pc->digit = 1; + } else if (c >= 0x41 && c <= 0x46) { /* 'A' - 'F' */ + pc->cache = c - 0x41 + 10; + pc->status = 5; + pc->digit = 1; + } else if (c >= 0x61 && c <= 0x66) { /* 'a' - 'f' */ + pc->cache = c - 0x61 + 10; + pc->status = 5; + pc->digit = 1; + } else { + pc->status = 0; + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + (*pc->decoder->filter_function)(0x78, pc->decoder); /* 'x' */ + (*pc->decoder->filter_function)(c, pc->decoder); + } + break; + case 5: + s = 0; + f = 0; + if ((c >= 0x30 && c <= 0x39) || + (c >= 0x41 && c <= 0x46) || + (c >= 0x61 && c <= 0x66)) { /* '0' - '9' or 'a' - 'f' */ + if (pc->digit > 9) { + pc->status = 0; + s = pc->cache; + f = 1; + } else { + if (c >= 0x30 && c <= 0x39) { + s = pc->cache*16 + (c - 0x30); + } else if (c >= 0x41 && c <= 0x46) { + s = pc->cache*16 + (c - 0x41 + 10); + } else { + s = pc->cache*16 + (c - 0x61 + 10); + } + pc->cache = s; + pc->digit++; + } + } else { + pc->status = 0; + s = pc->cache; + f = 1; + n = 0; + size = pc->mapsize; + while (n < size) { + mapelm = &(pc->convmap[n*4]); + d = s - mapelm[2]; + if (d >= mapelm[0] && d <= mapelm[1]) { + f = 0; + (*pc->decoder->filter_function)(d, pc->decoder); + if (c != 0x3b) {/* ';' */ + (*pc->decoder->filter_function)(c, pc->decoder); + } + break; + } + n++; + } + } + if (f) { + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + (*pc->decoder->filter_function)(0x78, pc->decoder); /* 'x' */ + r = 1; + n = pc->digit; + while (n > 0) { + r *= 16; + n--; + } + s %= r; + r /= 16; + while (r > 0) { + d = s/r;
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ libmbfl/mbfl/mbfilter.c mbstring.c
hirokawa Mon, 18 Jul 2011 08:36:17 + Revision: http://svn.php.net/viewvc?view=revision&revision=313366 Log: added numeric entities encode/decode in hex format. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c U php/php-src/trunk/ext/mbstring/mbstring.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c === --- php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c 2011-07-18 08:21:48 UTC (rev 313365) +++ php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c 2011-07-18 08:36:17 UTC (rev 313366) @@ -2746,7 +2746,9 @@ } break; case 2: - if (c >= 0x30 && c <= 0x39) { /* '0' - '9' */ + if (c == 0x78) {/* 'x' */ + pc->status = 4; + } else if (c >= 0x30 && c <= 0x39) { /* '0' - '9' */ pc->cache = c - 0x30; pc->status = 3; pc->digit = 1; @@ -2810,6 +2812,89 @@ (*pc->decoder->filter_function)(c, pc->decoder); } break; + case 4: + if (c >= 0x30 && c <= 0x39) { /* '0' - '9' */ + pc->cache = c - 0x30; + pc->status = 5; + pc->digit = 1; + } else if (c >= 0x41 && c <= 0x46) { /* 'A' - 'F' */ + pc->cache = c - 0x41 + 10; + pc->status = 5; + pc->digit = 1; + } else if (c >= 0x61 && c <= 0x66) { /* 'a' - 'f' */ + pc->cache = c - 0x61 + 10; + pc->status = 5; + pc->digit = 1; + } else { + pc->status = 0; + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + (*pc->decoder->filter_function)(0x78, pc->decoder); /* 'x' */ + (*pc->decoder->filter_function)(c, pc->decoder); + } + break; + case 5: + s = 0; + f = 0; + if ((c >= 0x30 && c <= 0x39) || + (c >= 0x41 && c <= 0x46) || + (c >= 0x61 && c <= 0x66)) { /* '0' - '9' or 'a' - 'f' */ + if (pc->digit > 9) { + pc->status = 0; + s = pc->cache; + f = 1; + } else { + if (c >= 0x30 && c <= 0x39) { + s = pc->cache*16 + (c - 0x30); + } else if (c >= 0x41 && c <= 0x46) { + s = pc->cache*16 + (c - 0x41 + 10); + } else { + s = pc->cache*16 + (c - 0x61 + 10); + } + pc->cache = s; + pc->digit++; + } + } else { + pc->status = 0; + s = pc->cache; + f = 1; + n = 0; + size = pc->mapsize; + while (n < size) { + mapelm = &(pc->convmap[n*4]); + d = s - mapelm[2]; + if (d >= mapelm[0] && d <= mapelm[1]) { + f = 0; + (*pc->decoder->filter_function)(d, pc->decoder); + if (c != 0x3b) {/* ';' */ + (*pc->decoder->filter_function)(c, pc->decoder); + } + break; + } + n++; + } + } + if (f) { + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + (*pc->decoder->filter_function)(0x78, pc->decoder); /* 'x' */ + r = 1; + n = pc->digit; + while (n > 0) { + r *= 16; + n--; + } + s %= r; + r /= 16; + while (r > 0) { + d = s/r; + s %= r; +
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ config.m4 config.w32
hirokawa Tue, 02 Aug 2011 02:50:11 + Revision: http://svn.php.net/viewvc?view=revision&revision=314080 Log: added new files of libmbfl 1.3.0. Changed paths: U php/php-src/trunk/ext/mbstring/config.m4 U php/php-src/trunk/ext/mbstring/config.w32 Modified: php/php-src/trunk/ext/mbstring/config.m4 === --- php/php-src/trunk/ext/mbstring/config.m42011-08-02 02:42:41 UTC (rev 314079) +++ php/php-src/trunk/ext/mbstring/config.m42011-08-02 02:50:11 UTC (rev 314080) @@ -264,6 +264,8 @@ libmbfl/filters/mbfilter_qprint.c libmbfl/filters/mbfilter_sjis.c libmbfl/filters/mbfilter_sjis_open.c + libmbfl/filters/mbfilter_sjis_mobile.c + libmbfl/filters/mbfilter_sjis_mac.c libmbfl/filters/mbfilter_tl_jisx0201_jisx0208.c libmbfl/filters/mbfilter_ucs2.c libmbfl/filters/mbfilter_ucs4.c Modified: php/php-src/trunk/ext/mbstring/config.w32 === --- php/php-src/trunk/ext/mbstring/config.w32 2011-08-02 02:42:41 UTC (rev 314079) +++ php/php-src/trunk/ext/mbstring/config.w32 2011-08-02 02:50:11 UTC (rev 314080) @@ -35,7 +35,7 @@ mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c \ mbfilter_koi8u.c mbfilter_cp1254.c \ mbfilter_uuencode.c mbfilter_armscii8.c mbfilter_cp850.c \ - mbfilter_cp5022x.c mbfilter_sjis_open.c \ + mbfilter_cp5022x.c mbfilter_sjis_open.c mbfilter_sjis_mobile.c mbfilter_sjis_mac.c \ mbfilter_tl_jisx0201_jisx0208.c", "mbstring"); ADD_SOURCES("ext/mbstring/libmbfl/mbfl", "mbfilter.c mbfilter_8bit.c \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ mbstring.c
hirokawa Tue, 02 Aug 2011 03:18:53 + Revision: http://svn.php.net/viewvc?view=revision&revision=314081 Log: added version number of libmbfl. Changed paths: U php/php-src/trunk/ext/mbstring/mbstring.c Modified: php/php-src/trunk/ext/mbstring/mbstring.c === --- php/php-src/trunk/ext/mbstring/mbstring.c 2011-08-02 02:50:11 UTC (rev 314080) +++ php/php-src/trunk/ext/mbstring/mbstring.c 2011-08-02 03:18:53 UTC (rev 314081) @@ -1682,6 +1682,11 @@ php_info_print_table_row(2, "Multibyte Support", "enabled"); php_info_print_table_row(2, "Multibyte string engine", "libmbfl"); php_info_print_table_row(2, "HTTP input encoding translation", MBSTRG(encoding_translation) ? "enabled": "disabled"); + { + char tmp[256]; + snprintf(tmp, sizeof(tmp), "%d.%d.%d", MBFL_VERSION_MAJOR, MBFL_VERSION_MINOR, MBFL_VERSION_TEENY); + php_info_print_table_row(2, "libmbfl version", tmp); + } php_info_print_table_end(); php_info_print_table_start(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.c mbfilter_sjis_mobile.h
hirokawa Wed, 03 Aug 2011 11:51:08 + Revision: http://svn.php.net/viewvc?view=revision&revision=314157 Log: fixed error handling on SJIS_Mobile. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-03 11:51:04 UTC (rev 314156) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-03 11:51:08 UTC (rev 314157) @@ -139,7 +139,7 @@ mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush + mbfl_filt_conv_sjis_mobile_flush }; const struct mbfl_convert_vtbl vtbl_sjis_kddi_wchar = { @@ -1080,6 +1080,23 @@ return c; } +int +mbfl_filt_conv_sjis_mobile_flush(mbfl_convert_filter *filter) +{ + int c1 = filter->cache; + if (filter->status == 1 && (c1 == 0x0023 || (c1 >= 0x0030 && c1<=0x0039))) { + CK((*filter->output_function)(c1, filter->data)); + } + filter->status = 0; + filter->cache = 0; + + if (filter->flush_function != NULL) { + return (*filter->flush_function)(filter->data); + } + + return 0; +} + static int mbfl_filt_ident_sjis_mobile(int c, mbfl_identify_filter *filter) { if (filter->status) { /* kanji second char */ Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h 2011-08-03 11:51:04 UTC (rev 314156) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h 2011-08-03 11:51:08 UTC (rev 314157) @@ -60,5 +60,6 @@ int mbfl_filt_conv_sjis_mobile_wchar(int c, mbfl_convert_filter *filter); int mbfl_filt_conv_wchar_sjis_mobile(int c, mbfl_convert_filter *filter); +int mbfl_filt_conv_sjis_mobile_flush(mbfl_convert_filter *filter); #endif /* MBFL_MBFILTER_SJIS_MOBILE_H */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.c
hirokawa Wed, 03 Aug 2011 11:55:43 + Revision: http://svn.php.net/viewvc?view=revision&revision=314158 Log: fixed error handling on SJIS_Mobile (for SB/KDDI). Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-03 11:51:08 UTC (rev 314157) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-03 11:55:43 UTC (rev 314158) @@ -157,7 +157,7 @@ mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush + mbfl_filt_conv_sjis_mobile_flush }; const struct mbfl_convert_vtbl vtbl_sjis_sb_wchar = { @@ -175,7 +175,7 @@ mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush + mbfl_filt_conv_sjis_mobile_flush }; const struct mbfl_convert_vtbl vtbl_sjis_docomo_pua_wchar = { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.c mbfilter_sjis_mobile.h
hirokawa Wed, 03 Aug 2011 12:09:28 + Revision: http://svn.php.net/viewvc?view=revision&revision=314159 Log: MF PHP_5_4. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-03 11:55:43 UTC (rev 314158) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-03 12:09:28 UTC (rev 314159) @@ -139,7 +139,7 @@ mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush + mbfl_filt_conv_sjis_mobile_flush }; const struct mbfl_convert_vtbl vtbl_sjis_kddi_wchar = { @@ -157,7 +157,7 @@ mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush + mbfl_filt_conv_sjis_mobile_flush }; const struct mbfl_convert_vtbl vtbl_sjis_sb_wchar = { @@ -175,7 +175,7 @@ mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush + mbfl_filt_conv_sjis_mobile_flush }; const struct mbfl_convert_vtbl vtbl_sjis_docomo_pua_wchar = { @@ -1080,6 +1080,23 @@ return c; } +int +mbfl_filt_conv_sjis_mobile_flush(mbfl_convert_filter *filter) +{ + int c1 = filter->cache; + if (filter->status == 1 && (c1 == 0x0023 || (c1 >= 0x0030 && c1<=0x0039))) { + CK((*filter->output_function)(c1, filter->data)); + } + filter->status = 0; + filter->cache = 0; + + if (filter->flush_function != NULL) { + return (*filter->flush_function)(filter->data); + } + + return 0; +} + static int mbfl_filt_ident_sjis_mobile(int c, mbfl_identify_filter *filter) { if (filter->status) { /* kanji second char */ Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h 2011-08-03 11:55:43 UTC (rev 314158) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h 2011-08-03 12:09:28 UTC (rev 314159) @@ -60,5 +60,6 @@ int mbfl_filt_conv_sjis_mobile_wchar(int c, mbfl_convert_filter *filter); int mbfl_filt_conv_wchar_sjis_mobile(int c, mbfl_convert_filter *filter); +int mbfl_filt_conv_sjis_mobile_flush(mbfl_convert_filter *filter); #endif /* MBFL_MBFILTER_SJIS_MOBILE_H */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Thu, 04 Aug 2011 12:11:04 + Revision: http://svn.php.net/viewvc?view=revision&revision=314254 Log: removed invalid 5,6 byte encoding from utf-8 based on Unicode 5.2. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-04 12:05:48 UTC (rev 314253) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-04 12:11:04 UTC (rev 314254) @@ -52,7 +52,7 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1 + 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1 }; static const char *mbfl_encoding_utf8_aliases[] = {"utf8", NULL}; @@ -111,40 +111,23 @@ case 0x10: /* 2byte code 2nd char */ case 0x21: /* 3byte code 3rd char */ case 0x32: /* 4byte code 4th char */ - case 0x43: /* 5byte code 5th char */ - case 0x54: /* 6byte code 6th char */ filter->status = 0; s = filter->cache | (c & 0x3f); if ((status == 0x10 && s >= 0x80) || (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x1) || - (status == 0x43 && s >= 0x20) || - (status == 0x54 && s >= 0x400 && s < MBFL_WCSGROUP_UCS4MAX)) { + (status == 0x32 && s >= 0x1 && s < 0x20)) { CK((*filter->output_function)(s, filter->data)); } break; case 0x20: /* 3byte code 2nd char */ case 0x31: /* 4byte code 3rd char */ - case 0x42: /* 5byte code 4th char */ - case 0x53: /* 6byte code 5th char */ filter->cache |= ((c & 0x3f) << 6); filter->status++; break; case 0x30: /* 4byte code 2nd char */ - case 0x41: /* 5byte code 3rd char */ - case 0x52: /* 6byte code 4th char */ filter->cache |= ((c & 0x3f) << 12); filter->status++; break; - case 0x40: /* 5byte code 2nd char */ - case 0x51: /* 6byte code 3rd char */ - filter->cache |= ((c & 0x3f) << 18); - filter->status++; - break; - case 0x50: /* 6byte code 2nd char */ - filter->cache |= ((c & 0x3f) << 24); - filter->status++; - break; default: filter->status = 0; break; @@ -158,12 +141,6 @@ } else if (c < 0xf8) { /* 4byte code first char */ filter->status = 0x30; filter->cache = (c & 0x7) << 18; - } else if (c < 0xfc) { /* 5byte code first char */ - filter->status = 0x40; - filter->cache = (c & 0x3) << 24; - } else if (c < 0xfe) { /* 6 byte code first char */ - filter->status = 0x50; - filter->cache = (c & 0x1) << 30; } else { filter->status = 0; filter->cache = 0; @@ -177,7 +154,7 @@ */ int mbfl_filt_conv_wchar_utf8(int c, mbfl_convert_filter *filter) { - if (c >= 0 && c < MBFL_WCSGROUP_UCS4MAX) { + if (c >= 0 && c < 0x20) { if (c < 0x80) { CK((*filter->output_function)(c, filter->data)); } else if (c < 0x800) { @@ -187,24 +164,11 @@ CK((*filter->output_function)(((c >> 12) & 0x0f) | 0xe0, filter->data)); CK((*filter->output_function)(((c >> 6) & 0x3f) | 0x80, filter->data)); CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); - } else if (c < 0x20) { + } else { CK((*filter->output_function)(((c >> 18) & 0x07) | 0xf0, filter->data)); CK((*filter->output_function)(((c >> 12) & 0x3f) | 0x80, filter->data)); CK((*filter->output_function)(((c >> 6) & 0x3f) | 0x80, filter->data)); CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); - } else if (c < 0x400) { - CK((*filter->output_function)(((c >> 24) & 0x03) | 0xf8, filter->data)); - CK((*filter->output_function)(((c >> 18)
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Thu, 04 Aug 2011 12:51:40 + Revision: http://svn.php.net/viewvc?view=revision&revision=314261 Log: MFH (removed obsolete/invalid 5,6 byte encoding of UTF-8 from mbstring/libmbfl based on Unicode 5.2. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-04 12:51:00 UTC (rev 314260) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-04 12:51:40 UTC (rev 314261) @@ -52,7 +52,7 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1 + 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1 }; static const char *mbfl_encoding_utf8_aliases[] = {"utf8", NULL}; @@ -111,40 +111,23 @@ case 0x10: /* 2byte code 2nd char */ case 0x21: /* 3byte code 3rd char */ case 0x32: /* 4byte code 4th char */ - case 0x43: /* 5byte code 5th char */ - case 0x54: /* 6byte code 6th char */ filter->status = 0; s = filter->cache | (c & 0x3f); if ((status == 0x10 && s >= 0x80) || (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x1) || - (status == 0x43 && s >= 0x20) || - (status == 0x54 && s >= 0x400 && s < MBFL_WCSGROUP_UCS4MAX)) { + (status == 0x32 && s >= 0x1 && s < 0x20)) { CK((*filter->output_function)(s, filter->data)); } break; case 0x20: /* 3byte code 2nd char */ case 0x31: /* 4byte code 3rd char */ - case 0x42: /* 5byte code 4th char */ - case 0x53: /* 6byte code 5th char */ filter->cache |= ((c & 0x3f) << 6); filter->status++; break; case 0x30: /* 4byte code 2nd char */ - case 0x41: /* 5byte code 3rd char */ - case 0x52: /* 6byte code 4th char */ filter->cache |= ((c & 0x3f) << 12); filter->status++; break; - case 0x40: /* 5byte code 2nd char */ - case 0x51: /* 6byte code 3rd char */ - filter->cache |= ((c & 0x3f) << 18); - filter->status++; - break; - case 0x50: /* 6byte code 2nd char */ - filter->cache |= ((c & 0x3f) << 24); - filter->status++; - break; default: filter->status = 0; break; @@ -158,12 +141,6 @@ } else if (c < 0xf8) { /* 4byte code first char */ filter->status = 0x30; filter->cache = (c & 0x7) << 18; - } else if (c < 0xfc) { /* 5byte code first char */ - filter->status = 0x40; - filter->cache = (c & 0x3) << 24; - } else if (c < 0xfe) { /* 6 byte code first char */ - filter->status = 0x50; - filter->cache = (c & 0x1) << 30; } else { filter->status = 0; filter->cache = 0; @@ -177,7 +154,7 @@ */ int mbfl_filt_conv_wchar_utf8(int c, mbfl_convert_filter *filter) { - if (c >= 0 && c < MBFL_WCSGROUP_UCS4MAX) { + if (c >= 0 && c < 0x20) { if (c < 0x80) { CK((*filter->output_function)(c, filter->data)); } else if (c < 0x800) { @@ -187,24 +164,11 @@ CK((*filter->output_function)(((c >> 12) & 0x0f) | 0xe0, filter->data)); CK((*filter->output_function)(((c >> 6) & 0x3f) | 0x80, filter->data)); CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); - } else if (c < 0x20) { + } else { CK((*filter->output_function)(((c >> 18) & 0x07) | 0xf0, filter->data)); CK((*filter->output_function)(((c >> 12) & 0x3f) | 0x80, filter->data)); CK((*filter->output_function)(((c >> 6) & 0x3f) | 0x80, filter->data)); CK((*filter->output_function)((c & 0x3f) | 0x80, filter->data)); - } else if (c < 0x400) { - CK((*filter->output_function)(((c >> 24) & 0x03) | 0xf8, filte
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Fri, 05 Aug 2011 04:28:24 + Revision: http://svn.php.net/viewvc?view=revision&revision=314302 Log: added check for invalid utf-8 encoding (merge from libmbfl-1.3.1). Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-05 03:41:24 UTC (rev 314301) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-05 04:28:24 UTC (rev 314302) @@ -98,7 +98,7 @@ */ int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter) { - int s; + int s, c1, w = 0; if (c < 0x80) { if (c >= 0) { @@ -108,40 +108,79 @@ } else if (c < 0xc0) { int status = filter->status & 0xff; switch (status) { - case 0x10: /* 2byte code 2nd char */ - case 0x21: /* 3byte code 3rd char */ - case 0x32: /* 4byte code 4th char */ + case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ + case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ + case 0x32: /* 4byte code 4th char: 0x80-0xbf */ filter->status = 0; s = filter->cache | (c & 0x3f); + filter->cache = 0; if ((status == 0x10 && s >= 0x80) || (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || (status == 0x32 && s >= 0x1 && s < 0x20)) { CK((*filter->output_function)(s, filter->data)); + } else { + w = s & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); } break; - case 0x20: /* 3byte code 2nd char */ - case 0x31: /* 4byte code 3rd char */ + case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,1-F:0x80-0x9f */ + s = filter->cache | ((c & 0x3f) << 6); + c1 = (s >> 12) & 0xf; + if ((c1 == 0x0 && c >= 0xa0) || c1 > 0) { + filter->cache = s; + filter->status++; + } else { + w = s & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); + filter->status = 0; + filter->cache = 0; + } + break; + case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ filter->cache |= ((c & 0x3f) << 6); filter->status++; break; - case 0x30: /* 4byte code 2nd char */ - filter->cache |= ((c & 0x3f) << 12); - filter->status++; + case 0x30: /* 4byte code 2nd char: 0:0x90-0xbf,1-3:0x80-0xbf,4:0x80-0x8f */ + s = filter->cache | ((c & 0x3f) << 12); + c1 = (s >> 18) & 0x7; + if ((c1 == 0x0 && c >= 0x90) || + (c1 > 0x0 && c1 < 0x4) || + (c1 == 0x4 && c < 0x90)) { + filter->cache = s; + filter->status++; + } else { + w = s & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); + filter->status = 0; + filter->cache = 0; + } break; default: filter->status = 0; break; } - } else if (c < 0xe0) { /* 2byte code first char */ + } else if (c < 0xc2) { /* invalid: 0xc0,0xc1 */ + w = c & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); + filter->status = 0; + filter->cache = 0; + } else if (c < 0xe0) { /* 2byte code first char: 0xc2-0xdf */ filter->status = 0x10; filter->cache = (c & 0x1f) << 6; - } else if (c < 0xf0) { /* 3byte code first char */ + } else if (c < 0xf0) { /* 3byte code first char: 0xe0-0xef */ filter->status = 0x20; filter->cache = (c & 0xf) << 1
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Fri, 05 Aug 2011 04:34:16 + Revision: http://svn.php.net/viewvc?view=revision&revision=314303 Log: MFH (added check for invalid utf-8 encoding). Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-05 04:28:24 UTC (rev 314302) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-05 04:34:16 UTC (rev 314303) @@ -98,7 +98,7 @@ */ int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter) { - int s; + int s, c1, w = 0; if (c < 0x80) { if (c >= 0) { @@ -108,40 +108,79 @@ } else if (c < 0xc0) { int status = filter->status & 0xff; switch (status) { - case 0x10: /* 2byte code 2nd char */ - case 0x21: /* 3byte code 3rd char */ - case 0x32: /* 4byte code 4th char */ + case 0x10: /* 2byte code 2nd char: 0x80-0xbf */ + case 0x21: /* 3byte code 3rd char: 0x80-0xbf */ + case 0x32: /* 4byte code 4th char: 0x80-0xbf */ filter->status = 0; s = filter->cache | (c & 0x3f); + filter->cache = 0; if ((status == 0x10 && s >= 0x80) || (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || (status == 0x32 && s >= 0x1 && s < 0x20)) { CK((*filter->output_function)(s, filter->data)); + } else { + w = s & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); } break; - case 0x20: /* 3byte code 2nd char */ - case 0x31: /* 4byte code 3rd char */ + case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,1-F:0x80-0x9f */ + s = filter->cache | ((c & 0x3f) << 6); + c1 = (s >> 12) & 0xf; + if ((c1 == 0x0 && c >= 0xa0) || c1 > 0) { + filter->cache = s; + filter->status++; + } else { + w = s & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); + filter->status = 0; + filter->cache = 0; + } + break; + case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ filter->cache |= ((c & 0x3f) << 6); filter->status++; break; - case 0x30: /* 4byte code 2nd char */ - filter->cache |= ((c & 0x3f) << 12); - filter->status++; + case 0x30: /* 4byte code 2nd char: 0:0x90-0xbf,1-3:0x80-0xbf,4:0x80-0x8f */ + s = filter->cache | ((c & 0x3f) << 12); + c1 = (s >> 18) & 0x7; + if ((c1 == 0x0 && c >= 0x90) || + (c1 > 0x0 && c1 < 0x4) || + (c1 == 0x4 && c < 0x90)) { + filter->cache = s; + filter->status++; + } else { + w = s & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); + filter->status = 0; + filter->cache = 0; + } break; default: filter->status = 0; break; } - } else if (c < 0xe0) { /* 2byte code first char */ + } else if (c < 0xc2) { /* invalid: 0xc0,0xc1 */ + w = c & MBFL_WCSGROUP_MASK; + w |= MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); + filter->status = 0; + filter->cache = 0; + } else if (c < 0xe0) { /* 2byte code first char: 0xc2-0xdf */ filter->status = 0x10; filter->cache = (c & 0x1f) << 6; - } else if (c < 0xf0) { /* 3byte code first char */ + } else if (c < 0xf0) { /* 3byte code first char: 0xe0-0xef */ filter->status = 0x20; filter->cac
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/mbfl/ mbfilter.h
hirokawa Sat, 06 Aug 2011 01:48:45 + Revision: http://svn.php.net/viewvc?view=revision&revision=314354 Log: updated libmbfl version to 1.3.1. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.h Modified: php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.h === --- php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.h 2011-08-06 01:24:20 UTC (rev 314353) +++ php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.h 2011-08-06 01:48:45 UTC (rev 314354) @@ -103,7 +103,7 @@ */ #define MBFL_VERSION_MAJOR 1 #define MBFL_VERSION_MINOR 3 -#define MBFL_VERSION_TEENY 0 +#define MBFL_VERSION_TEENY 1 /* * convert filter -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/ mbfilter.h
hirokawa Sat, 06 Aug 2011 01:49:10 + Revision: http://svn.php.net/viewvc?view=revision&revision=314355 Log: MFH (updated libmbfl version to 1.3.1). Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.h Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.h === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.h 2011-08-06 01:48:45 UTC (rev 314354) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.h 2011-08-06 01:49:10 UTC (rev 314355) @@ -103,7 +103,7 @@ */ #define MBFL_VERSION_MAJOR 1 #define MBFL_VERSION_MINOR 3 -#define MBFL_VERSION_TEENY 0 +#define MBFL_VERSION_TEENY 1 /* * convert filter -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Sat, 06 Aug 2011 02:22:15 + Revision: http://svn.php.net/viewvc?view=revision&revision=314357 Log: added ill-formed utf-8 check for 0xED. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-06 01:53:34 UTC (rev 314356) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-06 02:22:15 UTC (rev 314357) @@ -124,10 +124,12 @@ CK((*filter->output_function)(w, filter->data)); } break; - case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,1-F:0x80-0x9f */ + case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ s = filter->cache | ((c & 0x3f) << 6); c1 = (s >> 12) & 0xf; - if ((c1 == 0x0 && c >= 0xa0) || c1 > 0) { + if ((c1 == 0x0 && c >= 0xa0) || + (c1 == 0xd && c < 0xa0) || + (c1 > 0x0 && c1 != 0xd)) { filter->cache = s; filter->status++; } else { @@ -235,7 +237,9 @@ } else if (c < 0xc0) { switch (filter->status) { case 0x20: /* 3 byte code 2nd char */ - if ((c1 == 0x0 && c >= 0xa0) || c1 > 0x0) { + if ((c1 == 0x0 && c >= 0xa0) || + (c1 == 0xd && c < 0xa0) || + (c1 > 0x0 && c1 != 0xd)) { filter->status++; } else { filter->flag = 1; /* bad */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Sat, 06 Aug 2011 02:22:38 + Revision: http://svn.php.net/viewvc?view=revision&revision=314358 Log: MFH: added ill-formed utf-8 check for 0xED. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-06 02:22:15 UTC (rev 314357) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-06 02:22:38 UTC (rev 314358) @@ -124,10 +124,12 @@ CK((*filter->output_function)(w, filter->data)); } break; - case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,1-F:0x80-0x9f */ + case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ s = filter->cache | ((c & 0x3f) << 6); c1 = (s >> 12) & 0xf; - if ((c1 == 0x0 && c >= 0xa0) || c1 > 0) { + if ((c1 == 0x0 && c >= 0xa0) || + (c1 == 0xd && c < 0xa0) || + (c1 > 0x0 && c1 != 0xd)) { filter->cache = s; filter->status++; } else { @@ -235,7 +237,9 @@ } else if (c < 0xc0) { switch (filter->status) { case 0x20: /* 3 byte code 2nd char */ - if ((c1 == 0x0 && c >= 0xa0) || c1 > 0x0) { + if ((c1 == 0x0 && c >= 0xa0) || + (c1 == 0xd && c < 0xa0) || + (c1 > 0x0 && c1 != 0xd)) { filter->status++; } else { filter->flag = 1; /* bad */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Sat, 06 Aug 2011 04:25:44 + Revision: http://svn.php.net/viewvc?view=revision&revision=314359 Log: improved error handling for ill-formed utf-8 based on the Unicode recommendation. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-06 02:22:38 UTC (rev 314358) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-06 04:25:44 UTC (rev 314359) @@ -98,7 +98,7 @@ */ int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter) { - int s, c1, w = 0; + int s, c1, w = 0, flag = 0; if (c < 0x80) { if (c >= 0) { @@ -120,8 +120,7 @@ CK((*filter->output_function)(s, filter->data)); } else { w = s & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); + flag = 1; } break; case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ @@ -134,10 +133,7 @@ filter->status++; } else { w = s & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - filter->status = 0; - filter->cache = 0; + flag = 1; } break; case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ @@ -154,33 +150,47 @@ filter->status++; } else { w = s & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - filter->status = 0; - filter->cache = 0; + flag = 1; } break; default: - filter->status = 0; + w = c & MBFL_WCSGROUP_MASK; + flag = 1; break; } } else if (c < 0xc2) { /* invalid: 0xc0,0xc1 */ w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - filter->status = 0; - filter->cache = 0; + flag = 1; } else if (c < 0xe0) { /* 2byte code first char: 0xc2-0xdf */ - filter->status = 0x10; - filter->cache = (c & 0x1f) << 6; + if (filter->status == 0x0) { + filter->status = 0x10; + filter->cache = (c & 0x1f) << 6; + } else { + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } } else if (c < 0xf0) { /* 3byte code first char: 0xe0-0xef */ - filter->status = 0x20; - filter->cache = (c & 0xf) << 12; + if (filter->status == 0x0) { + filter->status = 0x20; + filter->cache = (c & 0xf) << 12; + } else { + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } } else if (c < 0xf5) { /* 4byte code first char: 0xf0-0xf4 */ - filter->status = 0x30; - filter->cache = (c & 0x7) << 18; + if (filter->status == 0x0) { + filter->status = 0x30; + filter->cache = (c & 0x7) << 18; + } else { + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } } else { w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } + + if (flag) { w |= MBFL_WCSGROUP_THROUGH; CK((*filter->output_function)(w, filter->data)); filter->status = 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Sat, 06 Aug 2011 04:28:26 + Revision: http://svn.php.net/viewvc?view=revision&revision=314360 Log: MFH: improved error handling for ill-formed utf-8 based on the Unicode recommendation. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-06 04:25:44 UTC (rev 314359) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-06 04:28:26 UTC (rev 314360) @@ -98,7 +98,7 @@ */ int mbfl_filt_conv_utf8_wchar(int c, mbfl_convert_filter *filter) { - int s, c1, w = 0; + int s, c1, w = 0, flag = 0; if (c < 0x80) { if (c >= 0) { @@ -120,8 +120,7 @@ CK((*filter->output_function)(s, filter->data)); } else { w = s & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); + flag = 1; } break; case 0x20: /* 3byte code 2nd char: 0:0xa0-0xbf,D:0x80-9F,1-C,E-F:0x80-0x9f */ @@ -134,10 +133,7 @@ filter->status++; } else { w = s & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - filter->status = 0; - filter->cache = 0; + flag = 1; } break; case 0x31: /* 4byte code 3rd char: 0x80-0xbf */ @@ -154,33 +150,47 @@ filter->status++; } else { w = s & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - filter->status = 0; - filter->cache = 0; + flag = 1; } break; default: - filter->status = 0; + w = c & MBFL_WCSGROUP_MASK; + flag = 1; break; } } else if (c < 0xc2) { /* invalid: 0xc0,0xc1 */ w = c & MBFL_WCSGROUP_MASK; - w |= MBFL_WCSGROUP_THROUGH; - CK((*filter->output_function)(w, filter->data)); - filter->status = 0; - filter->cache = 0; + flag = 1; } else if (c < 0xe0) { /* 2byte code first char: 0xc2-0xdf */ - filter->status = 0x10; - filter->cache = (c & 0x1f) << 6; + if (filter->status == 0x0) { + filter->status = 0x10; + filter->cache = (c & 0x1f) << 6; + } else { + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } } else if (c < 0xf0) { /* 3byte code first char: 0xe0-0xef */ - filter->status = 0x20; - filter->cache = (c & 0xf) << 12; + if (filter->status == 0x0) { + filter->status = 0x20; + filter->cache = (c & 0xf) << 12; + } else { + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } } else if (c < 0xf5) { /* 4byte code first char: 0xf0-0xf4 */ - filter->status = 0x30; - filter->cache = (c & 0x7) << 18; + if (filter->status == 0x0) { + filter->status = 0x30; + filter->cache = (c & 0x7) << 18; + } else { + w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } } else { w = c & MBFL_WCSGROUP_MASK; + flag = 1; + } + + if (flag) { w |= MBFL_WCSGROUP_THROUGH; CK((*filter->output_function)(w, filter->data)); filter->status = 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ mb_gpc.c
hirokawa Sat, 06 Aug 2011 12:19:16 + Revision: http://svn.php.net/viewvc?view=revision&revision=314369 Log: fixed encoding conversion when http_input=auto. Changed paths: U php/php-src/trunk/ext/mbstring/mb_gpc.c Modified: php/php-src/trunk/ext/mbstring/mb_gpc.c === --- php/php-src/trunk/ext/mbstring/mb_gpc.c 2011-08-06 09:58:55 UTC (rev 314368) +++ php/php-src/trunk/ext/mbstring/mb_gpc.c 2011-08-06 12:19:16 UTC (rev 314369) @@ -264,8 +264,8 @@ } else { /* auto detect */ from_encoding = NULL; - identd = mbfl_encoding_detector_new((enum mbfl_no_encoding *)info->from_encodings, info->num_from_encodings, MBSTRG(strict_detection)); - if (identd) { + identd = mbfl_encoding_detector_new2(info->from_encodings, info->num_from_encodings, MBSTRG(strict_detection)); + if (identd != NULL) { n = 0; while (n < num) { string.val = (unsigned char *)val_list[n]; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ mb_gpc.c
hirokawa Sat, 06 Aug 2011 12:19:33 + Revision: http://svn.php.net/viewvc?view=revision&revision=314370 Log: MFH: fixed encoding conversion when http_input=auto. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/mb_gpc.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/mb_gpc.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/mb_gpc.c 2011-08-06 12:19:16 UTC (rev 314369) +++ php/php-src/branches/PHP_5_4/ext/mbstring/mb_gpc.c 2011-08-06 12:19:33 UTC (rev 314370) @@ -264,8 +264,8 @@ } else { /* auto detect */ from_encoding = NULL; - identd = mbfl_encoding_detector_new((enum mbfl_no_encoding *)info->from_encodings, info->num_from_encodings, MBSTRG(strict_detection)); - if (identd) { + identd = mbfl_encoding_detector_new2(info->from_encodings, info->num_from_encodings, MBSTRG(strict_detection)); + if (identd != NULL) { n = 0; while (n < num) { string.val = (unsigned char *)val_list[n]; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mac.c
hirokawa Sat, 06 Aug 2011 15:23:06 + Revision: http://svn.php.net/viewvc?view=revision&revision=314377 Log: changed mapping of 0xa5 for SJIS-mac to prevent security attack. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c 2011-08-06 14:47:44 UTC (rev 314376) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c 2011-08-06 15:23:06 UTC (rev 314377) @@ -568,7 +568,7 @@ } else if (c == 0xa0) { s1 = 0x00a0; } else if (c == 0xa5) { /* YEN SIGN */ - s1 = 0x005c; + s1 = 0x216f;/* FULLWIDTH YEN SIGN */ } else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */ s1 = 0x2140; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mac.c
hirokawa Sat, 06 Aug 2011 15:24:31 + Revision: http://svn.php.net/viewvc?view=revision&revision=314378 Log: MFH: changed mapping of 0xa5 for SJIS-mac to prevent XSS. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c 2011-08-06 15:23:06 UTC (rev 314377) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c 2011-08-06 15:24:31 UTC (rev 314378) @@ -568,7 +568,7 @@ } else if (c == 0xa0) { s1 = 0x00a0; } else if (c == 0xa5) { /* YEN SIGN */ - s1 = 0x005c; + s1 = 0x216f; /* FULLWIDTH YEN SIGN */ } else if (c == 0xff3c) { /* FULLWIDTH REVERSE SOLIDUS */ s1 = 0x2140; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_hz.c mbfilter_sjis.c mbfilter_uhc.c unicode_table_cp932_ext.h unicode_table_cp936.h unicode_table_jis.h unicode_table_uhc.h
hirokawa Mon, 08 Aug 2011 16:14:30 + Revision: http://svn.php.net/viewvc?view=revision&revision=314546 Log: reduced memory footprint for codepages. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_hz.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_uhc.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_cp936.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_jis.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_uhc.h Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_hz.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_hz.c 2011-08-08 16:14:15 UTC (rev 314545) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_hz.c 2011-08-08 16:14:30 UTC (rev 314546) @@ -34,6 +34,7 @@ #include "mbfilter.h" #include "mbfilter_hz.h" +#define UNICODE_TABLE_CP936_DEF #include "unicode_table_cp936.h" static int mbfl_filt_ident_hz(int c, mbfl_identify_filter *filter); Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis.c 2011-08-08 16:14:15 UTC (rev 314545) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis.c 2011-08-08 16:14:30 UTC (rev 314546) @@ -34,6 +34,9 @@ #include "mbfilter.h" #include "mbfilter_sjis.h" +#define UNICODE_TABLE_CP932_DEF +#define UNICODE_TABLE_JIS_DEF + #include "unicode_table_cp932_ext.h" #include "unicode_table_jis.h" Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_uhc.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_uhc.c 2011-08-08 16:14:15 UTC (rev 314545) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_uhc.c 2011-08-08 16:14:30 UTC (rev 314546) @@ -33,6 +33,7 @@ #include "mbfilter.h" #include "mbfilter_uhc.h" +#define UNICODE_TABLE_UHC_DEF #include "unicode_table_uhc.h" static int mbfl_filt_ident_uhc(int c, mbfl_identify_filter *filter); Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h 2011-08-08 16:14:15 UTC (rev 314545) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h 2011-08-08 16:14:30 UTC (rev 314546) @@ -25,7 +25,9 @@ #ifndef UNICODE_TABLE_CP932_EXT_H #define UNICODE_TABLE_CP932_EXT_H -static const unsigned short cp932ext1_ucs_table[] = { +#ifdef UNICODE_TABLE_CP932_DEF + +const unsigned short cp932ext1_ucs_table[] = { /* ku 13 */ 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, 0x2468,0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F, @@ -40,10 +42,10 @@ 0x2261,0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220,0x221F, 0x22BF,0x2235,0x2229,0x222A,0x,0x }; -static const int cp932ext1_ucs_table_min = (13 - 1)*94; -static const int cp932ext1_ucs_table_max = (13 - 1)*94 + (sizeof (cp932ext1_ucs_table) / sizeof (unsigned short)); +const int cp932ext1_ucs_table_min = (13 - 1)*94; +const int cp932ext1_ucs_table_max = (13 - 1)*94 + (sizeof (cp932ext1_ucs_table) / sizeof (unsigned short)); -static const unsigned short cp932ext2_ucs_table[] = { +const unsigned short cp932ext2_ucs_table[] = { /* ku 89 */ 0x7E8A,0x891C,0x9348,0x9288,0x84DC,0x4FC9,0x70BB,0x6631, 0x68C8,0x92F9,0x66FB,0x5F45,0x4E28,0x4EE1,0x4EFC,0x4F00, @@ -100,10 +102,10 @@ 0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177, 0x2178,0x2179,0xFFE2,0xFFE4,0xFF07,0xFF02 }; -static const int cp932ext2_ucs_table_min = (89 - 1)*94; -static const int cp932ext2_ucs_table_max = (89 - 1)*94 + (sizeof (cp932ext2_ucs_table) / sizeof (unsigned short)); +const int cp932ext2_ucs_table_min = (89 - 1)*94; +const int cp932ext2_ucs_table_max = (89 - 1)*94 + (sizeof (cp932ext2_ucs_table) / sizeof (unsigned short)); -static const unsigned short cp932ext3_ucs_table[] = { +const unsigned short cp932ext3_ucs_table[] = { /* ku 115 */ 0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177, 0x2178,0x2179,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165, @@ -164,7 +166,22 @@ 0x9ADC,0x9B75,0x9B72,0x9B8F,0x9BB1,0x9BBB,0x9C00,0x9D70, 0x9D6B,0xFA2D,0x9E19,0x9ED1 }; -static const int cp932ext3_ucs_table_min = (115 - 1)*94; -static const int cp932ext3_ucs_table_max = (115 - 1)*94 + (sizeof (cp932ext3_ucs_table) / sizeof (unsigned short)); +const int cp932ext3_ucs_table_min = (115 - 1)*94; +const int cp932ext3_ucs_table_max = (115 - 1)*94 + (sizeof (cp932ext3_ucs_table) / sizeof (unsigned short)); +#else + +extern const unsigned short cp9
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_hz.c mbfilter_sjis.c mbfilter_uhc.c unicode_table_cp932_ext.h unicode_table_cp936.h unicode_table_jis.h unicode_tabl
hirokawa Mon, 08 Aug 2011 16:15:39 + Revision: http://svn.php.net/viewvc?view=revision&revision=314547 Log: MFH: reduced memory footprint for codepages. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_hz.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_uhc.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_cp936.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_jis.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_uhc.h Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_hz.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_hz.c 2011-08-08 16:14:30 UTC (rev 314546) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_hz.c 2011-08-08 16:15:39 UTC (rev 314547) @@ -34,6 +34,7 @@ #include "mbfilter.h" #include "mbfilter_hz.h" +#define UNICODE_TABLE_CP936_DEF #include "unicode_table_cp936.h" static int mbfl_filt_ident_hz(int c, mbfl_identify_filter *filter); Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis.c 2011-08-08 16:14:30 UTC (rev 314546) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis.c 2011-08-08 16:15:39 UTC (rev 314547) @@ -34,6 +34,9 @@ #include "mbfilter.h" #include "mbfilter_sjis.h" +#define UNICODE_TABLE_CP932_DEF +#define UNICODE_TABLE_JIS_DEF + #include "unicode_table_cp932_ext.h" #include "unicode_table_jis.h" Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_uhc.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_uhc.c 2011-08-08 16:14:30 UTC (rev 314546) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_uhc.c 2011-08-08 16:15:39 UTC (rev 314547) @@ -33,6 +33,7 @@ #include "mbfilter.h" #include "mbfilter_uhc.h" +#define UNICODE_TABLE_UHC_DEF #include "unicode_table_uhc.h" static int mbfl_filt_ident_uhc(int c, mbfl_identify_filter *filter); Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h 2011-08-08 16:14:30 UTC (rev 314546) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_cp932_ext.h 2011-08-08 16:15:39 UTC (rev 314547) @@ -25,7 +25,9 @@ #ifndef UNICODE_TABLE_CP932_EXT_H #define UNICODE_TABLE_CP932_EXT_H -static const unsigned short cp932ext1_ucs_table[] = { +#ifdef UNICODE_TABLE_CP932_DEF + +const unsigned short cp932ext1_ucs_table[] = { /* ku 13 */ 0x2460,0x2461,0x2462,0x2463,0x2464,0x2465,0x2466,0x2467, 0x2468,0x2469,0x246A,0x246B,0x246C,0x246D,0x246E,0x246F, @@ -40,10 +42,10 @@ 0x2261,0x222B,0x222E,0x2211,0x221A,0x22A5,0x2220,0x221F, 0x22BF,0x2235,0x2229,0x222A,0x,0x }; -static const int cp932ext1_ucs_table_min = (13 - 1)*94; -static const int cp932ext1_ucs_table_max = (13 - 1)*94 + (sizeof (cp932ext1_ucs_table) / sizeof (unsigned short)); +const int cp932ext1_ucs_table_min = (13 - 1)*94; +const int cp932ext1_ucs_table_max = (13 - 1)*94 + (sizeof (cp932ext1_ucs_table) / sizeof (unsigned short)); -static const unsigned short cp932ext2_ucs_table[] = { +const unsigned short cp932ext2_ucs_table[] = { /* ku 89 */ 0x7E8A,0x891C,0x9348,0x9288,0x84DC,0x4FC9,0x70BB,0x6631, 0x68C8,0x92F9,0x66FB,0x5F45,0x4E28,0x4EE1,0x4EFC,0x4F00, @@ -100,10 +102,10 @@ 0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177, 0x2178,0x2179,0xFFE2,0xFFE4,0xFF07,0xFF02 }; -static const int cp932ext2_ucs_table_min = (89 - 1)*94; -static const int cp932ext2_ucs_table_max = (89 - 1)*94 + (sizeof (cp932ext2_ucs_table) / sizeof (unsigned short)); +const int cp932ext2_ucs_table_min = (89 - 1)*94; +const int cp932ext2_ucs_table_max = (89 - 1)*94 + (sizeof (cp932ext2_ucs_table) / sizeof (unsigned short)); -static const unsigned short cp932ext3_ucs_table[] = { +const unsigned short cp932ext3_ucs_table[] = { /* ku 115 */ 0x2170,0x2171,0x2172,0x2173,0x2174,0x2175,0x2176,0x2177, 0x2178,0x2179,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165, @@ -164,7 +166,22 @@ 0x9ADC,0x9B75,0x9B72,0x9B8F,0x9BB1,0x9BBB,0x9C00,0x9D70, 0x9D6B,0xFA2D,0x9E19,0x9ED1 }; -static const int cp932ext3_ucs_table_min = (115 - 1)*94; -static const int cp932ext3_ucs_table_max = (115 - 1)*94 + (sizeof (cp932ext3_ucs_table) / sizeof (un
[PHP-CVS] svn: /php/php-src/trunk/ NEWS
hirokawa Tue, 09 Aug 2011 15:11:33 + Revision: http://svn.php.net/viewvc?view=revision&revision=314671 Log: update the news. Changed paths: U php/php-src/trunk/NEWS Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2011-08-09 15:08:03 UTC (rev 314670) +++ php/php-src/trunk/NEWS 2011-08-09 15:11:33 UTC (rev 314671) @@ -169,6 +169,10 @@ . Added paged results support. FR #42060. (a...@openldap.org, iaren...@eteo.mondragon.edu, jean...@au-fil-du.net, remy.sai...@gmail.com) +- Improved mbstring extension: + . Added Shift_JIS Emoji (pictograms) support. (rui) + . Ill-formed UTF-8 check for security enhancements. (rui) + - Improved MySQL extensions: . MySQL: Deprecated mysql_list_dbs(). FR #50667. (Andrey) . mysqlnd: Added named pipes support. FR #48082. (Andrey) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS
hirokawa Tue, 09 Aug 2011 15:11:51 + Revision: http://svn.php.net/viewvc?view=revision&revision=314672 Log: MFH: update the news. Changed paths: U php/php-src/branches/PHP_5_4/NEWS Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-08-09 15:11:33 UTC (rev 314671) +++ php/php-src/branches/PHP_5_4/NEWS 2011-08-09 15:11:51 UTC (rev 314672) @@ -8,6 +8,10 @@ - Fixed bug #55378: Binary number literal returns float number though its value is small enough. (Derick) +- Improved mbstring extension: + . Added Shift_JIS Emoji (pictograms) support. (rui) + . Ill-formed UTF-8 check for security enhancements. (rui) + 04 Aug 2011, PHP 5.4.0 Alpha 3 - Added features: . Short array syntax, see UPGRADING guide for full details (rsky0711 at gmail -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ config.w32
hirokawa Sat, 13 Aug 2011 12:53:40 + Revision: http://svn.php.net/viewvc?view=revision&revision=314868 Log: fixed win32 build. Changed paths: U php/php-src/trunk/ext/mbstring/config.w32 Modified: php/php-src/trunk/ext/mbstring/config.w32 === --- php/php-src/trunk/ext/mbstring/config.w32 2011-08-13 12:44:28 UTC (rev 314867) +++ php/php-src/trunk/ext/mbstring/config.w32 2011-08-13 12:53:40 UTC (rev 314868) @@ -32,7 +32,7 @@ mbfilter_iso2022_jp_ms.c \ mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \ mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \ - mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c \ + mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c mbfilter_utf8_mobile.c \ mbfilter_koi8u.c mbfilter_cp1254.c \ mbfilter_uuencode.c mbfilter_armscii8.c mbfilter_cp850.c \ mbfilter_cp5022x.c mbfilter_sjis_open.c mbfilter_sjis_mobile.c mbfilter_sjis_mac.c \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.h mbfilter_utf8_mobile.c
hirokawa Sat, 13 Aug 2011 13:17:36 + Revision: http://svn.php.net/viewvc?view=revision&revision=314869 Log: fixed compile warning. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h 2011-08-13 12:53:40 UTC (rev 314868) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h 2011-08-13 13:17:36 UTC (rev 314869) @@ -64,11 +64,11 @@ int mbfl_filt_conv_wchar_sjis_mobile(int c, mbfl_convert_filter *filter); int mbfl_filt_conv_sjis_mobile_flush(mbfl_convert_filter *filter); -int mbfiler_sjis_emoji_docomo2unicode(int s, int *snd); +int mbfilter_sjis_emoji_docomo2unicode(int s, int *snd); int mbfilter_sjis_emoji_kddi2unicode(int s, int *snd); int mbfilter_sjis_emoji_sb2unicode(int s, int *snd); -int mbfiler_unicode2sjis_emoji_docomo(int c, int *s1, mbfl_convert_filter *filter); +int mbfilter_unicode2sjis_emoji_docomo(int c, int *s1, mbfl_convert_filter *filter); int mbfilter_unicode2sjis_emoji_kddi(int c, int *s1, mbfl_convert_filter *filter); int mbfilter_unicode2sjis_emoji_sb(int c, int *s1, mbfl_convert_filter *filter); Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-13 12:53:40 UTC (rev 314868) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-13 13:17:36 UTC (rev 314869) @@ -193,8 +193,7 @@ int mbfl_filt_conv_utf8_mobile_wchar(int c, mbfl_convert_filter *filter) { int s, w = 0, flag = 0; - int s1 = 0, s2 = 0, c1 = 0, c2 = 0, snd = 0; - int sjis_encoded = 0; + int s1 = 0, c1 = 0, snd = 0; if (c < 0x80) { if (c >= 0) { @@ -320,7 +319,7 @@ int mbfl_filt_conv_wchar_utf8_mobile(int c, mbfl_convert_filter *filter) { if (c >= 0 && c < 0x11) { - int s1, s2, c1, c2; + int s1, c1; if ((filter->to->no_encoding == mbfl_no_encoding_utf8_docomo && mbfilter_unicode2sjis_emoji_docomo(c, &s1, filter) > 0 && -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ config.m4 config.w32 libmbfl/filters/Makefile.am libmbfl/filters/mbfilter_gb18030.c libmbfl/filters/mbfilter_gb18030.h libmbfl/filters/mbfilter_sjis_mac
hirokawa Sun, 14 Aug 2011 14:09:11 + Revision: http://svn.php.net/viewvc?view=revision&revision=314897 Log: added gb18030 encoding to mbstring/libmbfl.~ Changed paths: U php/php-src/trunk/ext/mbstring/config.m4 U php/php-src/trunk/ext/mbstring/config.w32 U php/php-src/trunk/ext/mbstring/libmbfl/filters/Makefile.am A php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c A php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_gb18030.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_cp936.h A php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_gb18030.h U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_consts.h U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_convert.c U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_ident.c Modified: php/php-src/trunk/ext/mbstring/config.m4 === --- php/php-src/trunk/ext/mbstring/config.m4 2011-08-14 10:18:59 UTC (rev 314896) +++ php/php-src/trunk/ext/mbstring/config.m4 2011-08-14 14:09:11 UTC (rev 314897) @@ -235,6 +235,7 @@ libmbfl/filters/mbfilter_cp866.c libmbfl/filters/mbfilter_cp932.c libmbfl/filters/mbfilter_cp936.c + libmbfl/filters/mbfilter_gb18030.c libmbfl/filters/mbfilter_euc_cn.c libmbfl/filters/mbfilter_euc_jp.c libmbfl/filters/mbfilter_euc_jp_win.c Modified: php/php-src/trunk/ext/mbstring/config.w32 === --- php/php-src/trunk/ext/mbstring/config.w32 2011-08-14 10:18:59 UTC (rev 314896) +++ php/php-src/trunk/ext/mbstring/config.w32 2011-08-14 14:09:11 UTC (rev 314897) @@ -29,7 +29,7 @@ mbfilter_iso8859_2.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c \ mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c \ mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_jis.c \ - mbfilter_iso2022_jp_ms.c \ + mbfilter_iso2022_jp_ms.c mbfilter_gb18030.c \ mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \ mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \ mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c mbfilter_utf8_mobile.c \ Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/Makefile.am === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/Makefile.am 2011-08-14 10:18:59 UTC (rev 314896) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/Makefile.am 2011-08-14 14:09:11 UTC (rev 314897) @@ -53,6 +53,7 @@ mbfilter_euc_kr.c \ mbfilter_uhc.c \ mbfilter_iso2022_jp_ms.c \ + mbfilter_gb18030.c \ mbfilter_iso2022_kr.c \ mbfilter_cp866.c \ mbfilter_koi8r.c \ @@ -76,6 +77,7 @@ mbfilter_cp866.h \ mbfilter_cp932.h \ mbfilter_cp936.h \ + mbfilter_gb18030.h \ mbfilter_euc_cn.h \ mbfilter_euc_jp.h \ mbfilter_euc_jp_win.h \ Added: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c (rev 0) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c 2011-08-14 14:09:11 UTC (rev 314897) @@ -0,0 +1,444 @@ +/* + * "streamable kanji code filter and converter" + * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. + * + * LICENSE NOTICES + * + * This file is part of "streamable kanji code filter and converter", + * which is distributed under the terms of GNU Lesser General Public + * License (version 2) as published by the Free Software Foundation. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with "streamable kanji code filter and converter"; + * if not, write to the Free Software Foundation, Inc., 59 Temple Place, + * Suite 330, Boston, MA 02111-1307 USA + * + * The author of this file: + * + */ +/* + * the source code included in this files was separated from mbfilter_cp936.c + * by rui hirokawa on 11 Aug 2011. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mbfilter.h" +#include "mbfilter_gb18030.h" + +#include "unicode_table_cp936.h" +#include "unicode_table_gb18030.h" + +static int mbfl_filt_ident_gb18030(int c, mbfl_identify_filter *filter); + +static const char *mbfl_encoding_gb18030_aliases[]
[PHP-CVS] svn: /php/php-src/trunk/ NEWS
hirokawa Sun, 14 Aug 2011 14:09:54 + Revision: http://svn.php.net/viewvc?view=revision&revision=314898 Log: NEWS update for mbstring. Changed paths: U php/php-src/trunk/NEWS Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2011-08-14 14:09:11 UTC (rev 314897) +++ php/php-src/trunk/NEWS 2011-08-14 14:09:54 UTC (rev 314898) @@ -172,6 +172,8 @@ - Improved mbstring extension: . Added Shift_JIS Emoji (pictograms) support. (rui) . Ill-formed UTF-8 check for security enhancements. (rui) + . Added MacJapanese (Shift_JIS) and gb18030 encoding support. (rui) + . Added encode/decode in hex format to mb_[en|de]code_numericentity(). (rui) - Improved MySQL extensions: . MySQL: Deprecated mysql_list_dbs(). FR #50667. (Andrey) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ config.m4 config.w32 libmbfl/filters/Makefile.am libmbfl/filters/mbfilter_gb18030.c libmbfl/filters/mbfilter_gb18030.h libmbfl/filters/mbfilt
hirokawa Sun, 14 Aug 2011 14:11:29 + Revision: http://svn.php.net/viewvc?view=revision&revision=314899 Log: MFH: added gb18030 encoding to mbstring/libmbfl.~ Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/config.m4 U php/php-src/branches/PHP_5_4/ext/mbstring/config.w32 U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/Makefile.am A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_gb18030.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_cp936.h A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_gb18030.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_consts.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_convert.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_ident.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/config.m4 === --- php/php-src/branches/PHP_5_4/ext/mbstring/config.m4 2011-08-14 14:09:54 UTC (rev 314898) +++ php/php-src/branches/PHP_5_4/ext/mbstring/config.m4 2011-08-14 14:11:29 UTC (rev 314899) @@ -235,6 +235,7 @@ libmbfl/filters/mbfilter_cp866.c libmbfl/filters/mbfilter_cp932.c libmbfl/filters/mbfilter_cp936.c + libmbfl/filters/mbfilter_gb18030.c libmbfl/filters/mbfilter_euc_cn.c libmbfl/filters/mbfilter_euc_jp.c libmbfl/filters/mbfilter_euc_jp_win.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/config.w32 === --- php/php-src/branches/PHP_5_4/ext/mbstring/config.w32 2011-08-14 14:09:54 UTC (rev 314898) +++ php/php-src/branches/PHP_5_4/ext/mbstring/config.w32 2011-08-14 14:11:29 UTC (rev 314899) @@ -29,7 +29,7 @@ mbfilter_iso8859_2.c mbfilter_iso8859_3.c mbfilter_iso8859_4.c \ mbfilter_iso8859_5.c mbfilter_iso8859_6.c mbfilter_iso8859_7.c \ mbfilter_iso8859_8.c mbfilter_iso8859_9.c mbfilter_jis.c \ - mbfilter_iso2022_jp_ms.c \ + mbfilter_iso2022_jp_ms.c mbfilter_gb18030.c \ mbfilter_koi8r.c mbfilter_qprint.c mbfilter_sjis.c mbfilter_ucs2.c \ mbfilter_ucs4.c mbfilter_uhc.c mbfilter_utf16.c mbfilter_utf32.c \ mbfilter_utf7.c mbfilter_utf7imap.c mbfilter_utf8.c mbfilter_utf8_mobile.c \ Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/Makefile.am === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/Makefile.am 2011-08-14 14:09:54 UTC (rev 314898) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/Makefile.am 2011-08-14 14:11:29 UTC (rev 314899) @@ -53,6 +53,7 @@ mbfilter_euc_kr.c \ mbfilter_uhc.c \ mbfilter_iso2022_jp_ms.c \ + mbfilter_gb18030.c \ mbfilter_iso2022_kr.c \ mbfilter_cp866.c \ mbfilter_koi8r.c \ @@ -76,6 +77,7 @@ mbfilter_cp866.h \ mbfilter_cp932.h \ mbfilter_cp936.h \ + mbfilter_gb18030.h \ mbfilter_euc_cn.h \ mbfilter_euc_jp.h \ mbfilter_euc_jp_win.h \ Added: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c (rev 0) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c 2011-08-14 14:11:29 UTC (rev 314899) @@ -0,0 +1,444 @@ +/* + * "streamable kanji code filter and converter" + * Copyright (c) 1998-2002 HappySize, Inc. All rights reserved. + * + * LICENSE NOTICES + * + * This file is part of "streamable kanji code filter and converter", + * which is distributed under the terms of GNU Lesser General Public + * License (version 2) as published by the Free Software Foundation. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with "streamable kanji code filter and converter"; + * if not, write to the Free Software Foundation, Inc., 59 Temple Place, + * Suite 330, Boston, MA 02111-1307 USA + * + * The author of this file: + * + */ +/* + * the source code included in this files was separated from mbfilter_cp936.c + * by rui hirokawa on 11 Aug 2011. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "mbfil
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS
hirokawa Sun, 14 Aug 2011 14:11:49 + Revision: http://svn.php.net/viewvc?view=revision&revision=314900 Log: MFH: NEWS update for mbstring. Changed paths: U php/php-src/branches/PHP_5_4/NEWS Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-08-14 14:11:29 UTC (rev 314899) +++ php/php-src/branches/PHP_5_4/NEWS 2011-08-14 14:11:49 UTC (rev 314900) @@ -11,6 +11,8 @@ - Improved mbstring extension: . Added Shift_JIS Emoji (pictograms) support. (rui) . Ill-formed UTF-8 check for security enhancements. (rui) + . Added MacJapanese (Shift_JIS) and gb18030 encoding support. (rui) + . Added encode/decode in hex format to mb_[en|de]code_numericentity(). (rui) - Improved NSAPI SAPI: (Uwe Schindler) . Don't set $_SERVER['HTTPS'] on unsecure connection (bug #55403). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ config.m4 config.w32 libmbfl/NEWS libmbfl/filters/Makefile.am libmbfl/filters/mbfilter_big5.c libmbfl/filters/mbfilter_big5.h libmbfl/filters/mbfilter_c
hirokawa Sat, 20 Aug 2011 07:24:04 + Revision: http://svn.php.net/viewvc?view=revision&revision=315223 Log: updated libmbfl to 1.3.2 (JISX-0213:2004 support). Changed paths: U php/php-src/trunk/ext/mbstring/config.m4 U php/php-src/trunk/ext/mbstring/config.w32 A php/php-src/trunk/ext/mbstring/libmbfl/NEWS U php/php-src/trunk/ext/mbstring/libmbfl/filters/Makefile.am U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_big5.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_big5.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_cp936.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c A php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.c A php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_hz.c A php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c A php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis.c A php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c A php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_cp936.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_jis.h A php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.h U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_consts.h U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_convert.c U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_ident.c -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ NEWS
hirokawa Sat, 20 Aug 2011 07:27:48 + Revision: http://svn.php.net/viewvc?view=revision&revision=315224 Log: update NEWS. Changed paths: U php/php-src/trunk/NEWS Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2011-08-20 07:24:04 UTC (rev 315223) +++ php/php-src/trunk/NEWS 2011-08-20 07:27:48 UTC (rev 315224) @@ -170,10 +170,13 @@ iaren...@eteo.mondragon.edu, jean...@au-fil-du.net, remy.sai...@gmail.com) - Improved mbstring extension: - . Added Shift_JIS Emoji (pictograms) support. (rui) - . Ill-formed UTF-8 check for security enhancements. (rui) - . Added MacJapanese (Shift_JIS) and gb18030 encoding support. (rui) - . Added encode/decode in hex format to mb_[en|de]code_numericentity(). (rui) + . Added Shift_JIS/UTF-8 Emoji (pictograms) support. (Rui) + . Added JIS X0213:2004 (Shift_JIS-2004, EUC-JP-2004, ISO-2022-JP-2004) support. (Rui) + . Ill-formed UTF-8 check for security enhancements. (Rui) + . Added MacJapanese (Shift_JIS) and gb18030 encoding support. (Rui) + . Added encode/decode in hex format to mb_[en|de]code_numericentity(). (Rui) + . Added user JIS X0213:2004 (Shift_JIS-2004, EUC-JP-2004, ISO-2022-JP-2004) support. (Rui) + . Added the user user defined area for CP936 and CP950 (Rui). - Improved MySQL extensions: . MySQL: Deprecated mysql_list_dbs(). FR #50667. (Andrey) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ config.m4 config.w32 libmbfl/NEWS libmbfl/filters/Makefile.am libmbfl/filters/mbfilter_big5.c libmbfl/filters/mbfilter_big5.h libmbfl/filters
hirokawa Sat, 20 Aug 2011 07:29:21 + Revision: http://svn.php.net/viewvc?view=revision&revision=315225 Log: MFH: updated limbfl to 1.3.2 Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/config.m4 U php/php-src/branches/PHP_5_4/ext/mbstring/config.w32 A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/NEWS U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/Makefile.am U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_big5.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_big5.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_cp936.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.c A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_hz.c A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis.c A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_cp936.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_jis.h A php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_consts.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_convert.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_ident.c -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS
hirokawa Sat, 20 Aug 2011 07:29:59 + Revision: http://svn.php.net/viewvc?view=revision&revision=315226 Log: update NEWS. Changed paths: U php/php-src/branches/PHP_5_4/NEWS Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-08-20 07:29:21 UTC (rev 315225) +++ php/php-src/branches/PHP_5_4/NEWS 2011-08-20 07:29:59 UTC (rev 315226) @@ -12,10 +12,13 @@ (virsacer at web dot de, Pierre) - Improved mbstring extension: - . Added Shift_JIS Emoji (pictograms) support. (rui) - . Ill-formed UTF-8 check for security enhancements. (rui) - . Added MacJapanese (Shift_JIS) and gb18030 encoding support. (rui) - . Added encode/decode in hex format to mb_[en|de]code_numericentity(). (rui) + . Added Shift_JIS/UTF-8 Emoji (pictograms) support. (Rui) + . Added JIS X0213:2004 (Shift_JIS-2004, EUC-JP-2004, ISO-2022-JP-2004) support. (Rui) + . Ill-formed UTF-8 check for security enhancements. (Rui) + . Added MacJapanese (Shift_JIS) and gb18030 encoding support. (Rui) + . Added encode/decode in hex format to mb_[en|de]code_numericentity(). (Rui) + . Added user JIS X0213:2004 (Shift_JIS-2004, EUC-JP-2004, ISO-2022-JP-2004) support. (Rui) + . Added the user user defined area for CP936 and CP950 (Rui). - Improved NSAPI SAPI: (Uwe Schindler) . Don't set $_SERVER['HTTPS'] on unsecure connection (bug #55403). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/ filters/Makefile.am filters/mbfilter_sjis_mobile.c filters/mbfilter_sjis_mobile.h mbfl/mbfl_convert.c mbfl/mbfl_encoding.c mbfl/mbfl_encoding.h
hirokawa Sat, 20 Aug 2011 08:27:57 + Revision: http://svn.php.net/viewvc?view=revision&revision=315229 Log: removed SJIS-Mobile#*PUA. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/Makefile.am U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_convert.c U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/Makefile.am === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/Makefile.am 2011-08-20 08:16:09 UTC (rev 315228) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/Makefile.am 2011-08-20 08:27:57 UTC (rev 315229) @@ -55,7 +55,7 @@ mbfilter_euc_kr.c \ mbfilter_uhc.c \ mbfilter_iso2022_jp_ms.c \ - mbfilter_iso2022_jp_2004.c \ + mbfilter_iso2022jp_2004.c \ mbfilter_gb18030.c \ mbfilter_iso2022_kr.c \ mbfilter_cp866.c \ @@ -90,7 +90,7 @@ mbfilter_htmlent.h \ mbfilter_hz.h \ mbfilter_iso2022_jp_ms.h \ - mbfilter_iso2022_jp_2004.h \ + mbfilter_iso2022jp_2004.h \ mbfilter_iso2022_kr.h \ mbfilter_iso8859_1.h \ mbfilter_iso8859_10.h \ Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-20 08:16:09 UTC (rev 315228) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-20 08:27:57 UTC (rev 315229) @@ -70,42 +70,6 @@ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE }; -const mbfl_encoding mbfl_encoding_sjis_docomo_pua = { - mbfl_no_encoding_sjis_docomo_pua, - "SJIS-Mobile#DOCOMO-PUA", - "Shift_JIS", - NULL, - mblen_table_sjis, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE -}; - -const mbfl_encoding mbfl_encoding_sjis_kddi_pua = { - mbfl_no_encoding_sjis_kddi_pua, - "SJIS-Mobile#KDDI-PUA", - "Shift_JIS", - NULL, - mblen_table_sjis, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE -}; - -const mbfl_encoding mbfl_encoding_sjis_kddi_pua_b = { - mbfl_no_encoding_sjis_kddi_pua_b, - "SJIS-Mobile#KDDI-PUA-B", - "Shift_JIS", - NULL, - mblen_table_sjis, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE -}; - -const mbfl_encoding mbfl_encoding_sjis_sb_pua = { - mbfl_no_encoding_sjis_sb_pua, - "SJIS-Mobile#SOFTBANK-PUA", - "Shift_JIS", - NULL, - mblen_table_sjis, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE -}; - const struct mbfl_identify_vtbl vtbl_identify_sjis_docomo = { mbfl_no_encoding_sjis_docomo, mbfl_filt_ident_common_ctor, @@ -181,78 +145,6 @@ mbfl_filt_conv_sjis_mobile_flush }; -const struct mbfl_convert_vtbl vtbl_sjis_docomo_pua_wchar = { - mbfl_no_encoding_sjis_docomo_pua, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_sjis_mobile_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_sjis_docomo_pua = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_sjis_docomo_pua, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_sjis_kddi_pua_wchar = { - mbfl_no_encoding_sjis_kddi_pua, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_sjis_mobile_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_sjis_kddi_pua = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_sjis_kddi_pua, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_sjis_kddi_pua_b_wchar = { - mbfl_no_encoding_sjis_kddi_pua_b, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_sjis_mobile_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_sjis_kddi_pua_b = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_sjis_kddi_pua_b, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_sjis_sb_pua_wchar = { - mbfl_no_encoding_sjis_sb_pua, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_sjis_mobile_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_sjis_sb_pua = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_sjis_sb_pua, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush -}; - static const char nflags_s[10
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/ filters/Makefile.am filters/mbfilter_sjis_mobile.c filters/mbfilter_sjis_mobile.h mbfl/mbfl_convert.c mbfl/mbfl_encoding.c mbfl/mbfl_
hirokawa Sat, 20 Aug 2011 08:28:40 + Revision: http://svn.php.net/viewvc?view=revision&revision=315230 Log: MFH: removed SJIS-Mobile#*PUA. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/Makefile.am U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_convert.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/Makefile.am === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/Makefile.am 2011-08-20 08:27:57 UTC (rev 315229) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/Makefile.am 2011-08-20 08:28:40 UTC (rev 315230) @@ -55,7 +55,7 @@ mbfilter_euc_kr.c \ mbfilter_uhc.c \ mbfilter_iso2022_jp_ms.c \ - mbfilter_iso2022_jp_2004.c \ + mbfilter_iso2022jp_2004.c \ mbfilter_gb18030.c \ mbfilter_iso2022_kr.c \ mbfilter_cp866.c \ @@ -90,7 +90,7 @@ mbfilter_htmlent.h \ mbfilter_hz.h \ mbfilter_iso2022_jp_ms.h \ - mbfilter_iso2022_jp_2004.h \ + mbfilter_iso2022jp_2004.h \ mbfilter_iso2022_kr.h \ mbfilter_iso8859_1.h \ mbfilter_iso8859_10.h \ Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-20 08:27:57 UTC (rev 315229) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-20 08:28:40 UTC (rev 315230) @@ -70,42 +70,6 @@ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE }; -const mbfl_encoding mbfl_encoding_sjis_docomo_pua = { - mbfl_no_encoding_sjis_docomo_pua, - "SJIS-Mobile#DOCOMO-PUA", - "Shift_JIS", - NULL, - mblen_table_sjis, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE -}; - -const mbfl_encoding mbfl_encoding_sjis_kddi_pua = { - mbfl_no_encoding_sjis_kddi_pua, - "SJIS-Mobile#KDDI-PUA", - "Shift_JIS", - NULL, - mblen_table_sjis, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE -}; - -const mbfl_encoding mbfl_encoding_sjis_kddi_pua_b = { - mbfl_no_encoding_sjis_kddi_pua_b, - "SJIS-Mobile#KDDI-PUA-B", - "Shift_JIS", - NULL, - mblen_table_sjis, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE -}; - -const mbfl_encoding mbfl_encoding_sjis_sb_pua = { - mbfl_no_encoding_sjis_sb_pua, - "SJIS-Mobile#SOFTBANK-PUA", - "Shift_JIS", - NULL, - mblen_table_sjis, - MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE -}; - const struct mbfl_identify_vtbl vtbl_identify_sjis_docomo = { mbfl_no_encoding_sjis_docomo, mbfl_filt_ident_common_ctor, @@ -181,78 +145,6 @@ mbfl_filt_conv_sjis_mobile_flush }; -const struct mbfl_convert_vtbl vtbl_sjis_docomo_pua_wchar = { - mbfl_no_encoding_sjis_docomo_pua, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_sjis_mobile_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_sjis_docomo_pua = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_sjis_docomo_pua, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_sjis_kddi_pua_wchar = { - mbfl_no_encoding_sjis_kddi_pua, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_sjis_mobile_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_sjis_kddi_pua = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_sjis_kddi_pua, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_sjis_kddi_pua_b_wchar = { - mbfl_no_encoding_sjis_kddi_pua_b, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_sjis_mobile_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_sjis_kddi_pua_b = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_sjis_kddi_pua_b, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_wchar_sjis_mobile, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_sjis_sb_pua_wchar = { - mbfl_no_encoding_sjis_sb_pua, - mbfl_no_encoding_wchar, - mbfl_filt_conv_common_ctor, - mbfl_filt_conv_common_dtor, - mbfl_filt_conv_sjis_mobile_wchar, - mbfl_filt_conv_common_flush -}; - -const struct mbfl_convert_vtbl vtbl_wchar_sjis_sb_pua = { - mbfl_no_encoding_wchar, - mbfl_no_encoding_sjis_sb_pua, - mbfl_filt_conv_common_ct
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_iso2022jp_2004.c mbfilter_sjis_2004.c unicode_table_jis2004.h
hirokawa Sun, 21 Aug 2011 02:22:53 + Revision: http://svn.php.net/viewvc?view=revision&revision=315249 Log: speed improvement of jisx0213 conversion. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c 2011-08-21 02:16:10 UTC (rev 315248) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c 2011-08-21 02:22:53 UTC (rev 315249) @@ -39,8 +39,6 @@ #include "unicode_table_jis.h" extern int mbfl_filt_conv_any_jis_flush(mbfl_convert_filter *filter); - -static int mbfl_filt_conv_2022jp_2004_flush(mbfl_convert_filter *filter); static int mbfl_filt_ident_2022jp_2004(int c, mbfl_identify_filter *filter); const mbfl_encoding mbfl_encoding_2022jp_2004 = { @@ -74,51 +72,9 @@ mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_wchar_jis2004, - mbfl_filt_conv_2022jp_2004_flush + mbfl_filt_conv_jis2004_flush }; -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -static int -mbfl_filt_conv_2022jp_2004_flush(mbfl_convert_filter *filter) -{ - int k, c1, c2, s1, s2; - - k = filter->cache; - - if ((filter->status & 0xf) == 1 && k >= 0 && k <= jisx0213_u2_tbl_len) { - s1 = jisx0213_u2_fb_tbl[k]; - c1 = (s1 >> 8) & 0x7f; - c2 = s1 & 0x7f; - - if ((filter->status & 0xff00) != 0x200) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x24, filter->data)); /* '$' */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x51, filter->data)); /* 'Q' */ - } - filter->status = 0x200; - CK((*filter->output_function)(c1, filter->data)); - CK((*filter->output_function)(c2, filter->data)); - } - filter->cache = 0; - - /* back to latin */ - if ((filter->status & 0xff00) != 0) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x42, filter->data)); /* 'B' */ - } - - filter->status &= 0xff; - - if (filter->flush_function != NULL) { - return (*filter->flush_function)(filter->data); - } - - return 0; -} - static int mbfl_filt_ident_2022jp_2004(int c, mbfl_identify_filter *filter) { retry: Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c 2011-08-21 02:16:10 UTC (rev 315248) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c 2011-08-21 02:22:53 UTC (rev 315249) @@ -34,8 +34,6 @@ #include "mbfilter.h" #include "mbfilter_sjis_2004.h" -#define UNICODE_TABLE_JIS2004_DEF - #include "unicode_table_jis2004.h" #include "unicode_table_jis.h" @@ -43,20 +41,6 @@ static int mbfl_filt_ident_sjis2004(int c, mbfl_identify_filter *filter); -static const int uni2sjis_tbl_range[][2] = { - {0x, 0x045f}, - {0x4e00, 0x9fff}, - {0xff00, 0xffe5}, - {0xfa0f, 0xfa6a}, -}; - -static const unsigned short *uni2sjis_tbl[] = { - ucs_a1_jisx0213_table, - ucs_i_jisx0213_table, - ucs_r_jisx0213_table, - ucs_r2_jisx0213_table, -}; - extern int mbfl_filt_ident_sjis(int c, mbfl_identify_filter *filter); extern int mbfl_bisec_srch(int w, const unsigned short *tbl, int n); extern int mbfl_bisec_srch2(int w, const unsigned short tbl[], int n); @@ -236,7 +220,7 @@ w1 = (s1 << 8) | s2; if (w1 >= 0x2121) { - + /* conversion for combining characters */ if ((w1 >= 0x2477 && w1 <= 0x2479) || (w1 >= 0x2479 && w1 <= 0x247B) || (w1 >= 0x2577 && w1 <= 0x257E) || w1 == 0x2678 || w1 == 0x2B44 || (w1 >= 0x2B48 && w1 <= 0x2B4F) || (w1 >= 0x2B65 && w1 <= 0x2B66)) { @@ -248,6 +232,7 @@ } } + /* conversion for BMP */ if (w <= 0) { w1 = (s1 - 0x21)*94 + s2 - 0x21; if (w1 >= 0 && w1 < jisx0213_ucs_table_size) { @@ -255,6 +240,7 @@ } } + /* conversion for CJK Unified Ideographs ext.B (U+2) */ if (w <= 0) { w1 = (s1 << 8) | s2; k = mbfl_bisec_srch2(w1, jisx0213_jis_u5_key, jisx0213_u5_tbl_len); @@ -285,7 +271,7 @@ } break; - case 2: /* got 0x8e : EUC-JP-2004 */ + case 2: /* got 0x8e : EUC-JP-2004 kana */ filter->status = 0; if (c > 0xa0 && c < 0xe0) { w = 0xfec0 + c; @@ -300,41 +286,65 @@ } break; - case 3: /* got 0x8f, X 0213 plane 2 first char : EUC-JP-2004 */ + case 3: /* X 0213 plane 2 first char : EUC-JP-2004 (0x8f), ISO-2022-JP-2004 */ if ((c >= 0 && c < 0x21) || c == 0x7f) { /* CTLs */ CK((*filter->output_function)(c, fi
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_iso2022jp_2004.c mbfilter_sjis_2004.c unicode_table_jis2004.h
hirokawa Sun, 21 Aug 2011 02:23:33 + Revision: http://svn.php.net/viewvc?view=revision&revision=315250 Log: MFH: speed improvement of jisx0213 conversion. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c 2011-08-21 02:22:53 UTC (rev 315249) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c 2011-08-21 02:23:33 UTC (rev 315250) @@ -39,8 +39,6 @@ #include "unicode_table_jis.h" extern int mbfl_filt_conv_any_jis_flush(mbfl_convert_filter *filter); - -static int mbfl_filt_conv_2022jp_2004_flush(mbfl_convert_filter *filter); static int mbfl_filt_ident_2022jp_2004(int c, mbfl_identify_filter *filter); const mbfl_encoding mbfl_encoding_2022jp_2004 = { @@ -74,51 +72,9 @@ mbfl_filt_conv_common_ctor, mbfl_filt_conv_common_dtor, mbfl_filt_conv_wchar_jis2004, - mbfl_filt_conv_2022jp_2004_flush + mbfl_filt_conv_jis2004_flush }; -#define CK(statement) do { if ((statement) < 0) return (-1); } while (0) - -static int -mbfl_filt_conv_2022jp_2004_flush(mbfl_convert_filter *filter) -{ - int k, c1, c2, s1, s2; - - k = filter->cache; - - if ((filter->status & 0xf) == 1 && k >= 0 && k <= jisx0213_u2_tbl_len) { - s1 = jisx0213_u2_fb_tbl[k]; - c1 = (s1 >> 8) & 0x7f; - c2 = s1 & 0x7f; - - if ((filter->status & 0xff00) != 0x200) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x24, filter->data)); /* '$' */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x51, filter->data)); /* 'Q' */ - } - filter->status = 0x200; - CK((*filter->output_function)(c1, filter->data)); - CK((*filter->output_function)(c2, filter->data)); - } - filter->cache = 0; - - /* back to latin */ - if ((filter->status & 0xff00) != 0) { - CK((*filter->output_function)(0x1b, filter->data)); /* ESC */ - CK((*filter->output_function)(0x28, filter->data)); /* '(' */ - CK((*filter->output_function)(0x42, filter->data)); /* 'B' */ - } - - filter->status &= 0xff; - - if (filter->flush_function != NULL) { - return (*filter->flush_function)(filter->data); - } - - return 0; -} - static int mbfl_filt_ident_2022jp_2004(int c, mbfl_identify_filter *filter) { retry: Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c 2011-08-21 02:22:53 UTC (rev 315249) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c 2011-08-21 02:23:33 UTC (rev 315250) @@ -34,8 +34,6 @@ #include "mbfilter.h" #include "mbfilter_sjis_2004.h" -#define UNICODE_TABLE_JIS2004_DEF - #include "unicode_table_jis2004.h" #include "unicode_table_jis.h" @@ -43,20 +41,6 @@ static int mbfl_filt_ident_sjis2004(int c, mbfl_identify_filter *filter); -static const int uni2sjis_tbl_range[][2] = { - {0x, 0x045f}, - {0x4e00, 0x9fff}, - {0xff00, 0xffe5}, - {0xfa0f, 0xfa6a}, -}; - -static const unsigned short *uni2sjis_tbl[] = { - ucs_a1_jisx0213_table, - ucs_i_jisx0213_table, - ucs_r_jisx0213_table, - ucs_r2_jisx0213_table, -}; - extern int mbfl_filt_ident_sjis(int c, mbfl_identify_filter *filter); extern int mbfl_bisec_srch(int w, const unsigned short *tbl, int n); extern int mbfl_bisec_srch2(int w, const unsigned short tbl[], int n); @@ -236,7 +220,7 @@ w1 = (s1 << 8) | s2; if (w1 >= 0x2121) { - + /* conversion for combining characters */ if ((w1 >= 0x2477 && w1 <= 0x2479) || (w1 >= 0x2479 && w1 <= 0x247B) || (w1 >= 0x2577 && w1 <= 0x257E) || w1 == 0x2678 || w1 == 0x2B44 || (w1 >= 0x2B48 && w1 <= 0x2B4F) || (w1 >= 0x2B65 && w1 <= 0x2B66)) { @@ -248,6 +232,7 @@ } } + /* conversion for BMP */ if (w <= 0) { w1 = (s1 - 0x21)*94 + s2 - 0x21; if (w1 >= 0 && w1 < jisx0213_ucs_table_size) { @@ -255,6 +240,7 @@ } } + /* conversion for CJK Unified Ideographs ext.B (U+2) */ if (w <= 0) { w1 = (s1 << 8) | s2; k = mbfl_bisec_srch2(w1, jisx0213_jis_u5_key, jisx0213_u5_tbl_len); @@ -285,7 +271,7 @@ } break; - case 2: /* got 0x8e : EUC-JP-2004 */ + case 2: /* got 0x8e : EUC-JP-2004 kana */ filter->status = 0; if (c > 0xa0 && c < 0xe0) { w = 0xfec0 + c; @@ -300,41 +286,65 @@ } break; - case 3: /* got 0x8f, X 0213 plane 2 first char : EUC-JP-2004 */ + case 3: /* X 0213 plane 2 first char : EUC-JP-2004 (0x8f), ISO-2022
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_2004.c unicode_table_jis2004.h
hirokawa Sun, 21 Aug 2011 05:02:21 + Revision: http://svn.php.net/viewvc?view=revision&revision=315251 Log: cleanup jisx0213 table. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c 2011-08-21 02:23:33 UTC (rev 315250) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c 2011-08-21 05:02:21 UTC (rev 315251) @@ -547,7 +547,7 @@ } } - /* check for major japanese chars */ + /* check for major japanese chars: U+4E00 - U+9FFF */ if (s1 <= 0) { for (k=0; k < uni2jis_tbl_len ;k++) { if (c >= uni2jis_tbl_range[k][0] && c <= uni2jis_tbl_range[k][1]) { @@ -557,7 +557,7 @@ } } - /* check for japanese chars in compressed area */ + /* check for japanese chars in compressed mapping area: U+1E00 - U+4DBF */ if (s1 <= 0 && c >= ucs_c1_jisx0213_min && c <= ucs_c1_jisx0213_max) { k = mbfl_bisec_srch(c, ucs_c1_jisx0213_tbl, ucs_c1_jisx0213_tbl_len); if (k >= 0) { @@ -574,14 +574,24 @@ } if (s1 <= 0) { + /* CJK Compatibility Forms: U+FE30 - U+FE4F */ + if (c == 0xfe45) { + s1 = 0x233e; + } else if (c == 0xfe46) { + s1 = 0x233d; + } else if (c >= 0xf91d && c <= 0xf9dc) { + /* CJK Compatibility Ideographs: U+F900 - U+F92A */ + k = mbfl_bisec_srch2(c, ucs_r2b_jisx0213_cmap_key, ucs_r2b_jisx0213_cmap_len); + if (k >= 0) { + s1 = ucs_r2b_jisx0213_cmap_val[k]; + } + } + } + + if (s1 <= 0) { c1 = c & ~MBFL_WCSPLANE_MASK; if (c1 == MBFL_WCSPLANE_JIS0213) { s1 = c & MBFL_WCSPLANE_MASK; - } else { - k = mbfl_bisec_srch2(c, jisx0213_uni2sjis_cmap_key, jisx0213_uni2sjis_cmap_len); - if (k >= 0) { - s1 = jisx0213_uni2sjis_cmap_val[k]; - } } if (c == 0) { s1 = 0; Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h 2011-08-21 02:23:33 UTC (rev 315250) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h 2011-08-21 05:02:21 UTC (rev 315251) @@ -4585,6 +4585,7 @@ static const int ucs_i_jisx0213_table_max = 0x4E00 + (sizeof(ucs_i_jisx0213_table)/ sizeof(unsigned short)); +/* Halfwidth and Fullwidth Forms */ static const unsigned short ucs_r_jisx0213_table[] = { // 0xff00 - 0xffe5 /* FF00h */ @@ -4622,6 +4623,7 @@ static const int ucs_r_jisx0213_table_max = 0xFF00 + (sizeof(ucs_r_jisx0213_table)/ sizeof(unsigned short)); +/* CJK Compatibility Ideographs : U+F900 - U+FAFF */ static const unsigned short ucs_r2_jisx0213_table[] = { // 0xfa0f - 0xfa6a 0x2F4B, 0x2F57,0x4F72,0x,0x8679,0x757A,0x775A,0x776F,0x, @@ -4640,8 +4642,47 @@ static const int ucs_r2_jisx0213_min = 0xFA0F; static const int ucs_r2_jisx0213_max = 0xFA6A; -static const unsigned short ucs_c1_jisx0213_tbl[] = { - // 0x1e00 - 0x4dff +/* + CJK Compatibility Ideographs: U+F900 - U+FAFF (seperate mapping for U+F9XX) +*/ +static const unsigned short ucs_r2b_jisx0213_cmap_key[] = { + 0xf91d,0xf928,0xf929,0xf936,0xf970,0xf9d0,0xf9dc}; + +static const unsigned short ucs_r2b_jisx0213_cmap_val[] = { + 0x763b,0x742e,0x754e,0x7b4f,0x7649,0x7e24,0x7d5d}; + +static const int ucs_r2b_jisx0213_cmap_len = + sizeof(ucs_r2b_jisx0213_cmap_key)/sizeof(unsigned short); + +/* + U+1E00 - U+4DBF in compresed mapping + + Latin Extended Additional: U+1E00 - U+1EFF + Greek Extended: U+1F00 - U+1FFF + General Punctuation: U+2000 - U+206F + Currency Symbols U+20A0 - U+20CF + Combining Diacritical Marks for Symbols: U+20D0 - 20FF + Number Forms: U+2150 - U+218F + Arrow : U+2190 - U+21FF + Mathematical Operations : U+2200 - U+22FF + Miscellaneous Technical : U+2300 - U+23FF + Enclosed Alphanumerics : U+2460 - U+24FF + Box Drawing: U+2500 - U+257F + Geometric Shapes: U+25A0 - U+25FF + Miscellanuous Symbols : U+2600 - U+26FF + Digba
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_sjis_2004.c unicode_table_jis2004.h
hirokawa Sun, 21 Aug 2011 05:02:33 + Revision: http://svn.php.net/viewvc?view=revision&revision=315252 Log: MFH: cleanup jisx0213 table. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c 2011-08-21 05:02:21 UTC (rev 315251) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c 2011-08-21 05:02:33 UTC (rev 315252) @@ -547,7 +547,7 @@ } } - /* check for major japanese chars */ + /* check for major japanese chars: U+4E00 - U+9FFF */ if (s1 <= 0) { for (k=0; k < uni2jis_tbl_len ;k++) { if (c >= uni2jis_tbl_range[k][0] && c <= uni2jis_tbl_range[k][1]) { @@ -557,7 +557,7 @@ } } - /* check for japanese chars in compressed area */ + /* check for japanese chars in compressed mapping area: U+1E00 - U+4DBF */ if (s1 <= 0 && c >= ucs_c1_jisx0213_min && c <= ucs_c1_jisx0213_max) { k = mbfl_bisec_srch(c, ucs_c1_jisx0213_tbl, ucs_c1_jisx0213_tbl_len); if (k >= 0) { @@ -574,14 +574,24 @@ } if (s1 <= 0) { + /* CJK Compatibility Forms: U+FE30 - U+FE4F */ + if (c == 0xfe45) { + s1 = 0x233e; + } else if (c == 0xfe46) { + s1 = 0x233d; + } else if (c >= 0xf91d && c <= 0xf9dc) { + /* CJK Compatibility Ideographs: U+F900 - U+F92A */ + k = mbfl_bisec_srch2(c, ucs_r2b_jisx0213_cmap_key, ucs_r2b_jisx0213_cmap_len); + if (k >= 0) { + s1 = ucs_r2b_jisx0213_cmap_val[k]; + } + } + } + + if (s1 <= 0) { c1 = c & ~MBFL_WCSPLANE_MASK; if (c1 == MBFL_WCSPLANE_JIS0213) { s1 = c & MBFL_WCSPLANE_MASK; - } else { - k = mbfl_bisec_srch2(c, jisx0213_uni2sjis_cmap_key, jisx0213_uni2sjis_cmap_len); - if (k >= 0) { - s1 = jisx0213_uni2sjis_cmap_val[k]; - } } if (c == 0) { s1 = 0; Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h 2011-08-21 05:02:21 UTC (rev 315251) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h 2011-08-21 05:02:33 UTC (rev 315252) @@ -4585,6 +4585,7 @@ static const int ucs_i_jisx0213_table_max = 0x4E00 + (sizeof(ucs_i_jisx0213_table)/ sizeof(unsigned short)); +/* Halfwidth and Fullwidth Forms */ static const unsigned short ucs_r_jisx0213_table[] = { // 0xff00 - 0xffe5 /* FF00h */ @@ -4622,6 +4623,7 @@ static const int ucs_r_jisx0213_table_max = 0xFF00 + (sizeof(ucs_r_jisx0213_table)/ sizeof(unsigned short)); +/* CJK Compatibility Ideographs : U+F900 - U+FAFF */ static const unsigned short ucs_r2_jisx0213_table[] = { // 0xfa0f - 0xfa6a 0x2F4B, 0x2F57,0x4F72,0x,0x8679,0x757A,0x775A,0x776F,0x, @@ -4640,8 +4642,47 @@ static const int ucs_r2_jisx0213_min = 0xFA0F; static const int ucs_r2_jisx0213_max = 0xFA6A; -static const unsigned short ucs_c1_jisx0213_tbl[] = { - // 0x1e00 - 0x4dff +/* + CJK Compatibility Ideographs: U+F900 - U+FAFF (seperate mapping for U+F9XX) +*/ +static const unsigned short ucs_r2b_jisx0213_cmap_key[] = { + 0xf91d,0xf928,0xf929,0xf936,0xf970,0xf9d0,0xf9dc}; + +static const unsigned short ucs_r2b_jisx0213_cmap_val[] = { + 0x763b,0x742e,0x754e,0x7b4f,0x7649,0x7e24,0x7d5d}; + +static const int ucs_r2b_jisx0213_cmap_len = + sizeof(ucs_r2b_jisx0213_cmap_key)/sizeof(unsigned short); + +/* + U+1E00 - U+4DBF in compresed mapping + + Latin Extended Additional: U+1E00 - U+1EFF + Greek Extended: U+1F00 - U+1FFF + General Punctuation: U+2000 - U+206F + Currency Symbols U+20A0 - U+20CF + Combining Diacritical Marks for Symbols: U+20D0 - 20FF + Number Forms: U+2150 - U+218F + Arrow : U+2190 - U+21FF + Mathematical Operations : U+2200 - U+22FF + Miscellaneous Technical : U+2300 - U+23FF + Enclosed Alphanumerics : U+2460 - U+24FF + Box Drawing:
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.h mbfilter_utf8_mobile.c
hirokawa Sat, 27 Aug 2011 00:07:20 + Revision: http://svn.php.net/viewvc?view=revision&revision=315589 Log: update pua conversion tables. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h 2011-08-26 23:57:48 UTC (rev 315588) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h 2011-08-27 00:07:20 UTC (rev 315589) @@ -47,6 +47,11 @@ extern const struct mbfl_convert_vtbl vtbl_sjis_sb_wchar; extern const struct mbfl_convert_vtbl vtbl_wchar_sjis_sb; +extern const unsigned short mbfl_docomo2uni_pua[4][3]; +extern const unsigned short mbfl_kddi2uni_pua[6][3]; +extern const unsigned short mbfl_sb2uni_pua[6][3]; +extern const unsigned short mbfl_kddi2uni_pua_b[8][3]; + int mbfl_filt_conv_sjis_mobile_wchar(int c, mbfl_convert_filter *filter); int mbfl_filt_conv_wchar_sjis_mobile(int c, mbfl_convert_filter *filter); int mbfl_filt_conv_sjis_mobile_flush(mbfl_convert_filter *filter); Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-26 23:57:48 UTC (rev 315588) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-27 00:07:20 UTC (rev 315589) @@ -37,10 +37,6 @@ #include "mbfilter_sjis_mobile.h" extern int mbfl_filt_ident_utf8(int c, mbfl_identify_filter *filter); -extern const int mbfl_docomo2uni_pua[4][3]; -extern const int mbfl_kddi2uni_pua[6][3]; -extern const int mbfl_sb2uni_pua[6][3]; -extern const int mbfl_kddi2uni_pua_b[8][3]; extern const unsigned char mblen_table_utf8[]; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.h mbfilter_utf8_mobile.c
hirokawa Sat, 27 Aug 2011 00:08:02 + Revision: http://svn.php.net/viewvc?view=revision&revision=315590 Log: MFH: update pua conversion tables. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h 2011-08-27 00:07:20 UTC (rev 315589) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h 2011-08-27 00:08:02 UTC (rev 315590) @@ -47,6 +47,11 @@ extern const struct mbfl_convert_vtbl vtbl_sjis_sb_wchar; extern const struct mbfl_convert_vtbl vtbl_wchar_sjis_sb; +extern const unsigned short mbfl_docomo2uni_pua[4][3]; +extern const unsigned short mbfl_kddi2uni_pua[6][3]; +extern const unsigned short mbfl_sb2uni_pua[6][3]; +extern const unsigned short mbfl_kddi2uni_pua_b[8][3]; + int mbfl_filt_conv_sjis_mobile_wchar(int c, mbfl_convert_filter *filter); int mbfl_filt_conv_wchar_sjis_mobile(int c, mbfl_convert_filter *filter); int mbfl_filt_conv_sjis_mobile_flush(mbfl_convert_filter *filter); Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-27 00:07:20 UTC (rev 315589) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-27 00:08:02 UTC (rev 315590) @@ -37,10 +37,6 @@ #include "mbfilter_sjis_mobile.h" extern int mbfl_filt_ident_utf8(int c, mbfl_identify_filter *filter); -extern const int mbfl_docomo2uni_pua[4][3]; -extern const int mbfl_kddi2uni_pua[6][3]; -extern const int mbfl_sb2uni_pua[6][3]; -extern const int mbfl_kddi2uni_pua_b[8][3]; extern const unsigned char mblen_table_utf8[]; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c mbfilter_utf8_mobile.c
hirokawa Sat, 27 Aug 2011 01:25:10 + Revision: http://svn.php.net/viewvc?view=revision&revision=315598 Log: corrected valid unicode area. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-27 01:23:12 UTC (rev 315597) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-27 01:25:10 UTC (rev 315598) @@ -116,7 +116,7 @@ filter->cache = 0; if ((status == 0x10 && s >= 0x80) || (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x1 && s < 0x20)) { + (status == 0x32 && s >= 0x1 && s < 0x11)) { CK((*filter->output_function)(s, filter->data)); } else { w = s & MBFL_WCSGROUP_MASK; Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-27 01:23:12 UTC (rev 315597) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-27 01:25:10 UTC (rev 315598) @@ -207,7 +207,7 @@ filter->cache = 0; if ((status == 0x10 && s >= 0x80) || (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x1 && s < 0x20)) { + (status == 0x32 && s >= 0x1 && s < 0x11)) { if (filter->from->no_encoding == mbfl_no_encoding_utf8_docomo && mbfilter_conv_r_map_tbl(s, &s1, mbfl_docomo2uni_pua, 4) > 0) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c mbfilter_utf8_mobile.c
hirokawa Sat, 27 Aug 2011 01:25:24 + Revision: http://svn.php.net/viewvc?view=revision&revision=315599 Log: MFH: corrected valid unicode area. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-27 01:25:10 UTC (rev 315598) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-08-27 01:25:24 UTC (rev 315599) @@ -116,7 +116,7 @@ filter->cache = 0; if ((status == 0x10 && s >= 0x80) || (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x1 && s < 0x20)) { + (status == 0x32 && s >= 0x1 && s < 0x11)) { CK((*filter->output_function)(s, filter->data)); } else { w = s & MBFL_WCSGROUP_MASK; Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-27 01:25:10 UTC (rev 315598) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-27 01:25:24 UTC (rev 315599) @@ -207,7 +207,7 @@ filter->cache = 0; if ((status == 0x10 && s >= 0x80) || (status == 0x21 && s >= 0x800 && (s < 0xd800 || s > 0xdfff)) || - (status == 0x32 && s >= 0x1 && s < 0x20)) { + (status == 0x32 && s >= 0x1 && s < 0x11)) { if (filter->from->no_encoding == mbfl_no_encoding_utf8_docomo && mbfilter_conv_r_map_tbl(s, &s1, mbfl_docomo2uni_pua, 4) > 0) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mac.c sjis_mac2uni.h
hirokawa Sun, 28 Aug 2011 04:32:22 + Revision: http://svn.php.net/viewvc?view=revision&revision=315631 Log: reduced footprint for sjis-mac Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/sjis_mac2uni.h Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c 2011-08-28 03:33:15 UTC (rev 315630) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c 2011-08-28 04:32:22 UTC (rev 315631) @@ -37,6 +37,8 @@ #include "unicode_table_cp932_ext.h" #include "unicode_table_jis.h" +#include "sjis_mac2uni.h" + extern int mbfl_filt_ident_sjis(int c, mbfl_identify_filter *filter); extern const unsigned char mblen_table_sjis[]; @@ -123,134 +125,6 @@ } \ } while (0) -#include "sjis_mac2uni.h" - -static const int code_tbl[][3] = { - {0x02f0, 0x0303, 0x2460}, - {0x030e, 0x0321, 0x2474}, - {0x032c, 0x0334, 0x2776}, - {0x0341, 0x0349, 0x2488}, - {0x034e, 0x0359, 0x2160}, - {0x0362, 0x036d, 0x2170}, - {0x038a, 0x03a3, 0x249c}, -}; - -static const int code_ofst_tbl[] [2]= { - {0x03ac, 0x03c9}, - {0x0406, 0x0420}, - {0x0432, 0x0441}, - {0x0468, 0x0480}, - {0x04b8, 0x04e8}, - {0x050c, 0x0551}, - {0x1ed9, 0x1f18}, - {0x1ff2, 0x20a5}, -}; - -static const int *code_map[] = { - sjis_mac2wchar1, sjis_mac2wchar2, sjis_mac2wchar3, sjis_mac2wchar4, - sjis_mac2wchar5, sjis_mac2wchar6, sjis_mac2wchar7, sjis_mac2wchar8}; - -static const int code_tbl_m[][6] = { - {0x0340, 0xf860, 0x0030, 0x002e, 0x, 0x}, - {0x03c9, 0xf860, 0x0054, 0x0042, 0x, 0x}, - {0x035c, 0xf860, 0x0058, 0x0056, 0x, 0x}, - {0x0370, 0xf860, 0x0078, 0x0076, 0x, 0x}, - {0x0439, 0xf860, 0x2193, 0x2191, 0x, 0x}, - {0x0409, 0xf861, 0x0046, 0x0041, 0x0058, 0x}, - {0x035b, 0xf861, 0x0058, 0x0049, 0x0056, 0x}, - {0x036f, 0xf861, 0x0078, 0x0069, 0x0076, 0x}, - {0x035a, 0xf862, 0x0058, 0x0049, 0x0049, 0x0049}, - {0x036e, 0xf862, 0x0078, 0x0069, 0x0069, 0x0069}, - {0x0522, 0xf862, 0x6709, 0x9650, 0x4f1a, 0x793e}, - {0x0523, 0xf862, 0x8ca1, 0x56e3, 0x6cd5, 0x4eba}, -}; - -static const int s_form_tbl[] = { - 0x2010,0x2016,0x2026, - 0x3001,0x3002,0x301c,0x3041,0x3043,0x3045,0x3047,0x3049, - 0x3063,0x3083,0x3085,0x3087,0x308e,0x30a1,0x30a3,0x30a5, - 0x30a7,0x30a9,0x30c3,0x30e3,0x30e5,0x30e7,0x30ee,0x30f5, - 0x30f6,0x30fc,0xff1d,0xff3b,0xff3d,0xff5c,0xffe3, // vertical f87e (34) - 0x2026,0xff47,0xff4d, // halfwidth f87f (3) - 0x5927,0x5c0f,0x63a7, // enclosing circle 20dd (3) - 0x21e6,0x21e7,0x21e8,0x21e9, // black arrow f87a (4) -}; - -static const int s_form_sjis_tbl[] = { - 0xeb5d,0xeb61,0xeb63, - 0xeb41,0xeb42,0xeb60,0xec9f,0xeca1,0xeca3,0xeca5,0xeca7, - 0xecc1,0xece1,0xece3,0xece5,0xecec,0xed40,0xed42,0xed44, - 0xed46,0xed48,0xed62,0xed83,0xed85,0xed87,0xed8e,0xed95, - 0xed96,0xeb5b,0xeb81,0xeb6d,0xeb6e,0xeb62,0xeb50, // vertical - 0x00ff,0x864b,0x8645, // halfwidth - 0x8791,0x8792,0x879d, // enclosing circle - 0x86d4,0x86d5,0x86d3,0x86d6, // black arrow -}; - -static const int s_form_sjis_fallback_tbl[] = { - 0x815d,0x8161,0x8163, - 0x8141,0x8142,0x8160,0x829f,0x82a1,0x82a3,0x82a5,0x82a7, - 0x82c1,0x82e1,0x82e3,0x82e5,0x82ec,0x8340,0x8342,0x8344, - 0x8346,0x8348,0x8362,0x8383,0x8385,0x8387,0x838e,0x8395, - 0x8396,0x815b,0x8181,0x816d,0x816e,0x8162,0x8150, // vertical - 0x815d,0x8287,0x828d, // halfwidth - 0x91e5,0x8fac,0x8d54, // enclosing circle - 0x86d0,0x86d1,0x86cf,0x86d2, // arrow -}; - -static const int wchar2sjis_mac_r_tbl[][3] = { - {0x2160, 0x216b, 0x034e}, - {0x2170, 0x217b, 0x0362}, - {0x2460, 0x2473, 0x02f0}, - {0x2474, 0x2487, 0x030e}, - {0x2488, 0x2490, 0x0341}, - {0x249c, 0x24b5, 0x038a}, - {0x2776, 0x277e, 0x032c}, - {0x30f7, 0x30fa, 0x054e}, - {0x32a4, 0x32a9, 0x04ba}, -}; - -static const unsigned short wchar2sjis_mac_r_map[][2] = { - {0x2660, 0x2667}, - {0x322a, 0x3243}, - {0x3296, 0x329e}, - {0x3300, 0x33d4}, - {0xfe30, 0xfe44}, -}; - -static const int *wchar2sjis_mac_code_map[] = { - wchar2sjis_mac4, wchar2sjis_mac7, wchar2sjis_mac8, wchar2sjis_mac9, wchar2sjis_mac10}; - -static const int wchar2sjis_mac_wchar_tbl[][2] = { - {0x2109, 0x03c2}, - {0x2110, 0x21ef5}, - {0x2113, 0x03bc}, - {0x2116, 0x0406}, - {0x2121, 0x0408}, - {0x21c4, 0x0437}, - {0x21c5, 0x0438}, - {0x21c6, 0x0436}, - {0x21e6, 0x043b}, - {0x21e7, 0x043c}, - {0x21e8, 0x043a}, - {0x21e9, 0x043d}, - {0x221f, 0x0525}, - {0x222e, 0x0524}, - {0x22bf, 0x0526}, - {0x260e, 0x041f}, - {0x261c, 0x0433}, - {0x261d, 0x0434}, - {0x261e, 0x0432}, - {0x261f, 0x0435}, - {0x3004, 0x0420}, - {0x301d, 0x0538}, - {0x301f, 0x0539}, - {0x3020, 0x041e}, - {0x3094, 0x054c}, -}; - - - /* * SJIS-mac => wchar */ @@ -328,7 +202,7 @@ if (w == 0) { -for (i=0; i<12; i++) { +for (i=0; i= code_ofst_tbl[i][0] && s <= code_ofst_tbl[i][1]) {
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mac.c sjis_mac2uni.h
hirokawa Sun, 28 Aug 2011 04:32:33 + Revision: http://svn.php.net/viewvc?view=revision&revision=315632 Log: MFH: reduced footprint for sjis-mac Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/sjis_mac2uni.h Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c 2011-08-28 04:32:22 UTC (rev 315631) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c 2011-08-28 04:32:33 UTC (rev 315632) @@ -37,6 +37,8 @@ #include "unicode_table_cp932_ext.h" #include "unicode_table_jis.h" +#include "sjis_mac2uni.h" + extern int mbfl_filt_ident_sjis(int c, mbfl_identify_filter *filter); extern const unsigned char mblen_table_sjis[]; @@ -123,134 +125,6 @@ } \ } while (0) -#include "sjis_mac2uni.h" - -static const int code_tbl[][3] = { - {0x02f0, 0x0303, 0x2460}, - {0x030e, 0x0321, 0x2474}, - {0x032c, 0x0334, 0x2776}, - {0x0341, 0x0349, 0x2488}, - {0x034e, 0x0359, 0x2160}, - {0x0362, 0x036d, 0x2170}, - {0x038a, 0x03a3, 0x249c}, -}; - -static const int code_ofst_tbl[] [2]= { - {0x03ac, 0x03c9}, - {0x0406, 0x0420}, - {0x0432, 0x0441}, - {0x0468, 0x0480}, - {0x04b8, 0x04e8}, - {0x050c, 0x0551}, - {0x1ed9, 0x1f18}, - {0x1ff2, 0x20a5}, -}; - -static const int *code_map[] = { - sjis_mac2wchar1, sjis_mac2wchar2, sjis_mac2wchar3, sjis_mac2wchar4, - sjis_mac2wchar5, sjis_mac2wchar6, sjis_mac2wchar7, sjis_mac2wchar8}; - -static const int code_tbl_m[][6] = { - {0x0340, 0xf860, 0x0030, 0x002e, 0x, 0x}, - {0x03c9, 0xf860, 0x0054, 0x0042, 0x, 0x}, - {0x035c, 0xf860, 0x0058, 0x0056, 0x, 0x}, - {0x0370, 0xf860, 0x0078, 0x0076, 0x, 0x}, - {0x0439, 0xf860, 0x2193, 0x2191, 0x, 0x}, - {0x0409, 0xf861, 0x0046, 0x0041, 0x0058, 0x}, - {0x035b, 0xf861, 0x0058, 0x0049, 0x0056, 0x}, - {0x036f, 0xf861, 0x0078, 0x0069, 0x0076, 0x}, - {0x035a, 0xf862, 0x0058, 0x0049, 0x0049, 0x0049}, - {0x036e, 0xf862, 0x0078, 0x0069, 0x0069, 0x0069}, - {0x0522, 0xf862, 0x6709, 0x9650, 0x4f1a, 0x793e}, - {0x0523, 0xf862, 0x8ca1, 0x56e3, 0x6cd5, 0x4eba}, -}; - -static const int s_form_tbl[] = { - 0x2010,0x2016,0x2026, - 0x3001,0x3002,0x301c,0x3041,0x3043,0x3045,0x3047,0x3049, - 0x3063,0x3083,0x3085,0x3087,0x308e,0x30a1,0x30a3,0x30a5, - 0x30a7,0x30a9,0x30c3,0x30e3,0x30e5,0x30e7,0x30ee,0x30f5, - 0x30f6,0x30fc,0xff1d,0xff3b,0xff3d,0xff5c,0xffe3, // vertical f87e (34) - 0x2026,0xff47,0xff4d, // halfwidth f87f (3) - 0x5927,0x5c0f,0x63a7, // enclosing circle 20dd (3) - 0x21e6,0x21e7,0x21e8,0x21e9, // black arrow f87a (4) -}; - -static const int s_form_sjis_tbl[] = { - 0xeb5d,0xeb61,0xeb63, - 0xeb41,0xeb42,0xeb60,0xec9f,0xeca1,0xeca3,0xeca5,0xeca7, - 0xecc1,0xece1,0xece3,0xece5,0xecec,0xed40,0xed42,0xed44, - 0xed46,0xed48,0xed62,0xed83,0xed85,0xed87,0xed8e,0xed95, - 0xed96,0xeb5b,0xeb81,0xeb6d,0xeb6e,0xeb62,0xeb50, // vertical - 0x00ff,0x864b,0x8645, // halfwidth - 0x8791,0x8792,0x879d, // enclosing circle - 0x86d4,0x86d5,0x86d3,0x86d6, // black arrow -}; - -static const int s_form_sjis_fallback_tbl[] = { - 0x815d,0x8161,0x8163, - 0x8141,0x8142,0x8160,0x829f,0x82a1,0x82a3,0x82a5,0x82a7, - 0x82c1,0x82e1,0x82e3,0x82e5,0x82ec,0x8340,0x8342,0x8344, - 0x8346,0x8348,0x8362,0x8383,0x8385,0x8387,0x838e,0x8395, - 0x8396,0x815b,0x8181,0x816d,0x816e,0x8162,0x8150, // vertical - 0x815d,0x8287,0x828d, // halfwidth - 0x91e5,0x8fac,0x8d54, // enclosing circle - 0x86d0,0x86d1,0x86cf,0x86d2, // arrow -}; - -static const int wchar2sjis_mac_r_tbl[][3] = { - {0x2160, 0x216b, 0x034e}, - {0x2170, 0x217b, 0x0362}, - {0x2460, 0x2473, 0x02f0}, - {0x2474, 0x2487, 0x030e}, - {0x2488, 0x2490, 0x0341}, - {0x249c, 0x24b5, 0x038a}, - {0x2776, 0x277e, 0x032c}, - {0x30f7, 0x30fa, 0x054e}, - {0x32a4, 0x32a9, 0x04ba}, -}; - -static const unsigned short wchar2sjis_mac_r_map[][2] = { - {0x2660, 0x2667}, - {0x322a, 0x3243}, - {0x3296, 0x329e}, - {0x3300, 0x33d4}, - {0xfe30, 0xfe44}, -}; - -static const int *wchar2sjis_mac_code_map[] = { - wchar2sjis_mac4, wchar2sjis_mac7, wchar2sjis_mac8, wchar2sjis_mac9, wchar2sjis_mac10}; - -static const int wchar2sjis_mac_wchar_tbl[][2] = { - {0x2109, 0x03c2}, - {0x2110, 0x21ef5}, - {0x2113, 0x03bc}, - {0x2116, 0x0406}, - {0x2121, 0x0408}, - {0x21c4, 0x0437}, - {0x21c5, 0x0438}, - {0x21c6, 0x0436}, - {0x21e6, 0x043b}, - {0x21e7, 0x043c}, - {0x21e8, 0x043a}, - {0x21e9, 0x043d}, - {0x221f, 0x0525}, - {0x222e, 0x0524}, - {0x22bf, 0x0526}, - {0x260e, 0x041f}, - {0x261c, 0x0433}, - {0x261d, 0x0434}, - {0x261e, 0x0432}, - {0x261f, 0x0435}, - {0x3004, 0x0420}, - {0x301d, 0x0538}, - {0x301f, 0x0539}, - {0x3020, 0x041e}, - {0x3094, 0x054c}, -}; - - - /* * SJIS-mac => wchar */ @@ -328,7 +202,7 @@ if (w == 0) { -for (i=0; i<12; i++) { +for
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/ filters/mbfilter_iso2022jp_mobile.c filters/mbfilter_sjis_mobile.c filters/mbfilter_utf8_mobile.c filters/mbfilter_utf8_mobile.h mbfl/mbfl_conve
hirokawa Wed, 31 Aug 2011 13:18:44 + Revision: http://svn.php.net/viewvc?view=revision&revision=315890 Log: added alias for *-mobile encodings. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.h U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_convert.c U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfl_ident.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c 2011-08-31 13:17:44 UTC (rev 315889) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c 2011-08-31 13:18:44 UTC (rev 315890) @@ -42,12 +42,14 @@ extern int mbfl_filt_conv_any_jis_flush(mbfl_convert_filter *filter); extern int mbfl_filt_ident_2022jpms(int c, mbfl_identify_filter *filter); +static const char *mbfl_encoding_2022jp_kddi_aliases[] = {"ISO-2022-JP-KDDI", NULL}; + const mbfl_encoding mbfl_encoding_2022jp_kddi = { mbfl_no_encoding_2022jp_kddi, "ISO-2022-JP-MOBILE#KDDI", "ISO-2022-JP", + mbfl_encoding_2022jp_kddi_aliases, NULL, - NULL, MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE }; Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-31 13:17:44 UTC (rev 315889) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-31 13:18:44 UTC (rev 315890) @@ -44,11 +44,15 @@ extern int mbfl_filt_ident_sjis(int c, mbfl_identify_filter *filter); extern const unsigned char mblen_table_sjis[]; +static const char *mbfl_encoding_sjis_docomo_aliases[] = {"SJIS-DOCOMO", "shift_jis-imode", "x-sjis-emoji-docomo", NULL}; +static const char *mbfl_encoding_sjis_kddi_aliases[] = {"SJIS-KDDI", "shift_jis-kddi", "x-sjis-emoji-kddi", NULL}; +static const char *mbfl_encoding_sjis_sb_aliases[] = {"SJIS-SOFTBANK", "shift_jis-softbank", "x-sjis-emoji-softbank", NULL}; + const mbfl_encoding mbfl_encoding_sjis_docomo = { mbfl_no_encoding_sjis_docomo, "SJIS-Mobile#DOCOMO", "Shift_JIS", - NULL, + mbfl_encoding_sjis_docomo_aliases, mblen_table_sjis, MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE }; @@ -57,7 +61,7 @@ mbfl_no_encoding_sjis_kddi, "SJIS-Mobile#KDDI", "Shift_JIS", - NULL, + mbfl_encoding_sjis_kddi_aliases, mblen_table_sjis, MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE }; @@ -66,7 +70,7 @@ mbfl_no_encoding_sjis_sb, "SJIS-Mobile#SOFTBANK", "Shift_JIS", - NULL, + mbfl_encoding_sjis_sb_aliases, mblen_table_sjis, MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE }; Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-31 13:17:44 UTC (rev 315889) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-31 13:18:44 UTC (rev 315890) @@ -40,10 +40,10 @@ extern const unsigned char mblen_table_utf8[]; -static const char *mbfl_encoding_utf8_docomo_aliases[] = {"utf8-mobile#docomo", NULL}; -static const char *mbfl_encoding_utf8_kddi_aliases[] = {"utf8-mobile#kddi", NULL}; -static const char *mbfl_encoding_utf8_kddi_b_aliases[] = {"utf8-mobile#kddi-b", NULL}; -static const char *mbfl_encoding_utf8_sb_aliases[] = {"utf8-mobile#softbank", NULL}; +static const char *mbfl_encoding_utf8_docomo_aliases[] = {"UTF-8-DOCOMO", "UTF8-DOCOMO", NULL}; +static const char *mbfl_encoding_utf8_kddi_a_aliases[] = {"UTF-8-KDDI", "UTF8-KDDI", NULL}; +static const char *mbfl_encoding_utf8_kddi_b_aliases[] = {"UTF-8-Mobile#KDDI", "UTF-8-KDDI", "UTF8-KDDI", NULL}; +static const char *mbfl_encoding_utf8_sb_aliases[] = {"UTF-8-SOFTBANK", "UTF8-SOFTBANK", NULL}; const mbfl_encoding mbfl_encoding_utf8_docomo = { mbfl_no_encoding_utf8_docomo, @@ -54,11 +54,11 @@ MBFL_ENCTYPE_MBCS }; -const mbfl_encoding mbfl_encoding_utf8_kddi = { - mbfl_no_encoding_utf8_kddi, - "UTF-8-Mobile#KDDI", +const mbfl_encoding mbfl_encoding_utf8_kddi_a = { + mbfl_no_encoding_utf8_kddi_a, + "UTF-8-Mobile#KDDI-A", "UTF-8", - (const char *(*)[])&mbfl_encoding_utf8_kddi_aliases, + (const char *(*)[])&mbfl_encoding_utf8_kddi_a_aliases, mblen_table_utf8, MBFL_ENCTYPE_MBCS }; @@ -88,8 +88,8 @@ mbfl_filt_ident_utf8 }; -const struct mbfl_identify_vtbl vtbl_identify_ut
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/ filters/mbfilter_iso2022jp_mobile.c filters/mbfilter_sjis_mobile.c filters/mbfilter_utf8_mobile.c filters/mbfilter_utf8_mobile.h mbfl
hirokawa Wed, 31 Aug 2011 13:19:03 + Revision: http://svn.php.net/viewvc?view=revision&revision=315891 Log: MFH: added alias for *-mobile encodings. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_convert.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfl_ident.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c 2011-08-31 13:18:44 UTC (rev 315890) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c 2011-08-31 13:19:03 UTC (rev 315891) @@ -42,12 +42,14 @@ extern int mbfl_filt_conv_any_jis_flush(mbfl_convert_filter *filter); extern int mbfl_filt_ident_2022jpms(int c, mbfl_identify_filter *filter); +static const char *mbfl_encoding_2022jp_kddi_aliases[] = {"ISO-2022-JP-KDDI", NULL}; + const mbfl_encoding mbfl_encoding_2022jp_kddi = { mbfl_no_encoding_2022jp_kddi, "ISO-2022-JP-MOBILE#KDDI", "ISO-2022-JP", + mbfl_encoding_2022jp_kddi_aliases, NULL, - NULL, MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE }; Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-31 13:18:44 UTC (rev 315890) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-08-31 13:19:03 UTC (rev 315891) @@ -44,11 +44,15 @@ extern int mbfl_filt_ident_sjis(int c, mbfl_identify_filter *filter); extern const unsigned char mblen_table_sjis[]; +static const char *mbfl_encoding_sjis_docomo_aliases[] = {"SJIS-DOCOMO", "shift_jis-imode", "x-sjis-emoji-docomo", NULL}; +static const char *mbfl_encoding_sjis_kddi_aliases[] = {"SJIS-KDDI", "shift_jis-kddi", "x-sjis-emoji-kddi", NULL}; +static const char *mbfl_encoding_sjis_sb_aliases[] = {"SJIS-SOFTBANK", "shift_jis-softbank", "x-sjis-emoji-softbank", NULL}; + const mbfl_encoding mbfl_encoding_sjis_docomo = { mbfl_no_encoding_sjis_docomo, "SJIS-Mobile#DOCOMO", "Shift_JIS", - NULL, + mbfl_encoding_sjis_docomo_aliases, mblen_table_sjis, MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE }; @@ -57,7 +61,7 @@ mbfl_no_encoding_sjis_kddi, "SJIS-Mobile#KDDI", "Shift_JIS", - NULL, + mbfl_encoding_sjis_kddi_aliases, mblen_table_sjis, MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE }; @@ -66,7 +70,7 @@ mbfl_no_encoding_sjis_sb, "SJIS-Mobile#SOFTBANK", "Shift_JIS", - NULL, + mbfl_encoding_sjis_sb_aliases, mblen_table_sjis, MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE }; Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-31 13:18:44 UTC (rev 315890) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c 2011-08-31 13:19:03 UTC (rev 315891) @@ -40,10 +40,10 @@ extern const unsigned char mblen_table_utf8[]; -static const char *mbfl_encoding_utf8_docomo_aliases[] = {"utf8-mobile#docomo", NULL}; -static const char *mbfl_encoding_utf8_kddi_aliases[] = {"utf8-mobile#kddi", NULL}; -static const char *mbfl_encoding_utf8_kddi_b_aliases[] = {"utf8-mobile#kddi-b", NULL}; -static const char *mbfl_encoding_utf8_sb_aliases[] = {"utf8-mobile#softbank", NULL}; +static const char *mbfl_encoding_utf8_docomo_aliases[] = {"UTF-8-DOCOMO", "UTF8-DOCOMO", NULL}; +static const char *mbfl_encoding_utf8_kddi_a_aliases[] = {"UTF-8-KDDI", "UTF8-KDDI", NULL}; +static const char *mbfl_encoding_utf8_kddi_b_aliases[] = {"UTF-8-Mobile#KDDI", "UTF-8-KDDI", "UTF8-KDDI", NULL}; +static const char *mbfl_encoding_utf8_sb_aliases[] = {"UTF-8-SOFTBANK", "UTF8-SOFTBANK", NULL}; const mbfl_encoding mbfl_encoding_utf8_docomo = { mbfl_no_encoding_utf8_docomo, @@ -54,11 +54,11 @@ MBFL_ENCTYPE_MBCS }; -const mbfl_encoding mbfl_encoding_utf8_kddi = { - mbfl_no_encoding_utf8_kddi, - "UTF-8-Mobile#KDDI", +const mbfl_encoding mbfl_encoding_utf8_kddi_a = { + mbfl_no_encoding_utf8_kddi_a, + "UTF-8-Mobile#KDDI-A", "UTF-8", - (const char *(*)[])&mbfl_encoding_utf8_kddi_aliases, +
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Wed, 07 Sep 2011 14:30:06 + Revision: http://svn.php.net/viewvc?view=revision&revision=316357 Log: fixed invalid utf-8 check. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-09-07 14:25:12 UTC (rev 316356) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-09-07 14:30:06 UTC (rev 316357) @@ -101,10 +101,15 @@ int s, c1, w = 0, flag = 0; if (c < 0x80) { + if (filter->status != 0) { + w = (filter->cache & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); + filter->status = 0; + filter->cache = 0; + } if (c >= 0) { CK((*filter->output_function)(c, filter->data)); } - filter->status = 0; } else if (c < 0xc0) { int status = filter->status & 0xff; switch (status) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Wed, 07 Sep 2011 14:30:38 + Revision: http://svn.php.net/viewvc?view=revision&revision=316358 Log: MFH: fixed invalid utf-8 check. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-09-07 14:30:06 UTC (rev 316357) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-09-07 14:30:38 UTC (rev 316358) @@ -101,10 +101,15 @@ int s, c1, w = 0, flag = 0; if (c < 0x80) { + if (filter->status != 0) { + w = (filter->cache & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(w, filter->data)); + filter->status = 0; + filter->cache = 0; + } if (c >= 0) { CK((*filter->output_function)(c, filter->data)); } - filter->status = 0; } else if (c < 0xc0) { int status = filter->status & 0xff; switch (status) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ mbstring.c
hirokawa Thu, 08 Sep 2011 15:19:18 + Revision: http://svn.php.net/viewvc?view=revision&revision=316418 Log: 2nd arguments is necessary in mb_parse_str because register_globals was removed in PHP 5.4. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c2011-09-08 14:37:18 UTC (rev 316417) +++ php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c2011-09-08 15:19:18 UTC (rev 316418) @@ -245,7 +245,7 @@ ZEND_ARG_INFO(0, encoding) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_parse_str, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_parse_str, 0, 0, 2) ZEND_ARG_INFO(0, encoded_string) ZEND_ARG_INFO(1, result) ZEND_END_ARG_INFO() @@ -2025,7 +2025,7 @@ #define IS_SJIS1(c) c)>=0x81 && (c)<=0x9f) || ((c)>=0xe0 && (c)<=0xf5)) ? 1 : 0) #define IS_SJIS2(c) c)>=0x40 && (c)<=0x7e) || ((c)>=0x80 && (c)<=0xfc)) ? 1 : 0) -/* {{{ proto bool mb_parse_str(string encoded_string [, array result]) +/* {{{ proto bool mb_parse_str(string encoded_string , array result) Parses GET/POST/COOKIE data and sets global variables */ PHP_FUNCTION(mb_parse_str) { @@ -2036,7 +2036,7 @@ const mbfl_encoding *detected; track_vars_array = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &encstr, &encstr_len, &track_vars_array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &encstr, &encstr_len, &track_vars_array) == FAILURE) { return; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ mbstring.c
hirokawa Thu, 08 Sep 2011 15:20:17 + Revision: http://svn.php.net/viewvc?view=revision&revision=316419 Log: 2nd arguments is necessary in mb_parse_str because register_globals was removed in PHP 5.4. Changed paths: U php/php-src/trunk/ext/mbstring/mbstring.c Modified: php/php-src/trunk/ext/mbstring/mbstring.c === --- php/php-src/trunk/ext/mbstring/mbstring.c 2011-09-08 15:19:18 UTC (rev 316418) +++ php/php-src/trunk/ext/mbstring/mbstring.c 2011-09-08 15:20:17 UTC (rev 316419) @@ -245,7 +245,7 @@ ZEND_ARG_INFO(0, encoding) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_parse_str, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_parse_str, 0, 0, 2) ZEND_ARG_INFO(0, encoded_string) ZEND_ARG_INFO(1, result) ZEND_END_ARG_INFO() @@ -2025,7 +2025,7 @@ #define IS_SJIS1(c) c)>=0x81 && (c)<=0x9f) || ((c)>=0xe0 && (c)<=0xf5)) ? 1 : 0) #define IS_SJIS2(c) c)>=0x40 && (c)<=0x7e) || ((c)>=0x80 && (c)<=0xfc)) ? 1 : 0) -/* {{{ proto bool mb_parse_str(string encoded_string [, array result]) +/* {{{ proto bool mb_parse_str(string encoded_string , array result) Parses GET/POST/COOKIE data and sets global variables */ PHP_FUNCTION(mb_parse_str) { @@ -2036,7 +2036,7 @@ const mbfl_encoding *detected; track_vars_array = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &encstr, &encstr_len, &track_vars_array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &encstr, &encstr_len, &track_vars_array) == FAILURE) { return; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ bug20087.phpt
hirokawa Sun, 11 Sep 2011 02:16:34 + Revision: http://svn.php.net/viewvc?view=revision&revision=316483 Log: removed test script which depends on the removed register_globals. Changed paths: D php/php-src/trunk/ext/mbstring/tests/bug20087.phpt Deleted: php/php-src/trunk/ext/mbstring/tests/bug20087.phpt === --- php/php-src/trunk/ext/mbstring/tests/bug20087.phpt 2011-09-11 02:07:54 UTC (rev 316482) +++ php/php-src/trunk/ext/mbstring/tests/bug20087.phpt 2011-09-11 02:16:34 UTC (rev 316483) @@ -1,22 +0,0 @@ ---TEST-- -Bug #20087 (Assertion failure) ---SKIPIF-- - ---XFAIL-- -register_globals calls killed the ability for mb_parse_str() to register into the global scope ---FILE-- - ---EXPECT-- -bool(true) -string(0) "" -bool(true) -string(3) "moo" - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/tests/ bug20087.phpt
hirokawa Sun, 11 Sep 2011 02:16:58 + Revision: http://svn.php.net/viewvc?view=revision&revision=316484 Log: MFH: removed test script which depends on the removed register_globals. Changed paths: D php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt Deleted: php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt 2011-09-11 02:16:34 UTC (rev 316483) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt 2011-09-11 02:16:58 UTC (rev 316484) @@ -1,22 +0,0 @@ ---TEST-- -Bug #20087 (Assertion failure) ---SKIPIF-- - ---XFAIL-- -register_globals calls killed the ability for mb_parse_str() to register into the global scope ---FILE-- - ---EXPECT-- -bool(true) -string(0) "" -bool(true) -string(3) "moo" - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/tests/ bug20087.phpt mb_parse_str.phpt mb_parse_str02.phpt
hirokawa Sun, 11 Sep 2011 03:55:08 + Revision: http://svn.php.net/viewvc?view=revision&revision=316486 Log: revert previous commit. Changed paths: A php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str02.phpt Added: php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt 2011-09-11 03:55:08 UTC (rev 316486) @@ -0,0 +1,22 @@ +--TEST-- +Bug #20087 (Assertion failure) +--SKIPIF-- + +--XFAIL-- +register_globals calls killed the ability for mb_parse_str() to register into the global scope +--FILE-- + +--EXPECT-- +bool(true) +string(0) "" +bool(true) +string(3) "moo" + Property changes on: php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt ___ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str.phpt 2011-09-11 02:41:00 UTC (rev 316485) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str.phpt 2011-09-11 03:55:08 UTC (rev 316486) @@ -2,12 +2,14 @@ mb_parse_str() --SKIPIF-- ---XFAIL-- -register_globals calls killed the ability for mb_parse_str() to register into the global scope +--FAIL-- +register_globals calls killed the ability for mb_parse_str() to register into the global scope (obsolete in PHP 5.4) --INI-- arg_separator.input=& --FILE-- string(3) "def" @@ -47,6 +50,7 @@ } string(0) "" string(0) "" +ERR: Warning string(0) "" string(0) "" array(2) { @@ -67,15 +71,6 @@ } string(0) "" string(0) "" -array(3) { - [0]=> - string(3) "abc" - [1]=> - string(3) "def" - [2]=> - string(3) "ghi" -} -array(1) { - [0]=> - string(3) "jkl" -} +ERR: Warning +string(0) "" +string(0) "" Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str02.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str02.phpt 2011-09-11 02:41:00 UTC (rev 316485) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str02.phpt 2011-09-11 03:55:08 UTC (rev 316486) @@ -3,11 +3,13 @@ --SKIPIF-- --XFAIL-- -register_globals calls killed the ability for mb_parse_str() to register into the global scope +register_globals calls killed the ability for mb_parse_str() to register into the global scope (obsolete in PHP 5.4) --INI-- arg_separator.input= --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/tests/ mb_parse_str.phpt mb_parse_str02.phpt
hirokawa Sun, 11 Sep 2011 03:56:16 + Revision: http://svn.php.net/viewvc?view=revision&revision=316487 Log: revert previous commit. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str02.phpt Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str.phpt 2011-09-11 03:55:08 UTC (rev 316486) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str.phpt 2011-09-11 03:56:16 UTC (rev 316487) @@ -2,14 +2,12 @@ mb_parse_str() --SKIPIF-- ---FAIL-- -register_globals calls killed the ability for mb_parse_str() to register into the global scope (obsolete in PHP 5.4) +--XFAIL-- +register_globals calls killed the ability for mb_parse_str() to register into the global scope --INI-- arg_separator.input=& --FILE-- string(3) "def" @@ -50,7 +47,6 @@ } string(0) "" string(0) "" -ERR: Warning string(0) "" string(0) "" array(2) { @@ -71,6 +67,15 @@ } string(0) "" string(0) "" -ERR: Warning -string(0) "" -string(0) "" +array(3) { + [0]=> + string(3) "abc" + [1]=> + string(3) "def" + [2]=> + string(3) "ghi" +} +array(1) { + [0]=> + string(3) "jkl" +} Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str02.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str02.phpt 2011-09-11 03:55:08 UTC (rev 316486) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str02.phpt 2011-09-11 03:56:16 UTC (rev 316487) @@ -3,13 +3,11 @@ --SKIPIF-- --XFAIL-- -register_globals calls killed the ability for mb_parse_str() to register into the global scope (obsolete in PHP 5.4) +register_globals calls killed the ability for mb_parse_str() to register into the global scope --INI-- arg_separator.input= --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ bug20087.phpt
hirokawa Sun, 11 Sep 2011 03:57:31 + Revision: http://svn.php.net/viewvc?view=revision&revision=316488 Log: revert previous commit. Changed paths: A php/php-src/trunk/ext/mbstring/tests/bug20087.phpt Added: php/php-src/trunk/ext/mbstring/tests/bug20087.phpt === --- php/php-src/trunk/ext/mbstring/tests/bug20087.phpt (rev 0) +++ php/php-src/trunk/ext/mbstring/tests/bug20087.phpt 2011-09-11 03:57:31 UTC (rev 316488) @@ -0,0 +1,22 @@ +--TEST-- +Bug #20087 (Assertion failure) +--SKIPIF-- + +--XFAIL-- +register_globals calls killed the ability for mb_parse_str() to register into the global scope +--FILE-- + +--EXPECT-- +bool(true) +string(0) "" +bool(true) +string(3) "moo" + Property changes on: php/php-src/trunk/ext/mbstring/tests/bug20087.phpt ___ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ libmbfl/filters/mbfilter_utf32.c mbstring.c tests/bug20087.phpt tests/bug28220.phpt tests/bug49536.phpt tests/illformed_utf_sequences.phpt tests/mb_pars
hirokawa Sun, 11 Sep 2011 12:12:24 + Revision: http://svn.php.net/viewvc?view=revision&revision=316491 Log: fixed test case failures. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf32.c U php/php-src/trunk/ext/mbstring/mbstring.c U php/php-src/trunk/ext/mbstring/tests/bug20087.phpt U php/php-src/trunk/ext/mbstring/tests/bug28220.phpt U php/php-src/trunk/ext/mbstring/tests/bug49536.phpt U php/php-src/trunk/ext/mbstring/tests/illformed_utf_sequences.phpt U php/php-src/trunk/ext/mbstring/tests/mb_parse_str.phpt U php/php-src/trunk/ext/mbstring/tests/mb_parse_str02.phpt Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf32.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf32.c 2011-09-11 11:28:12 UTC (rev 316490) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf32.c 2011-09-11 12:12:24 UTC (rev 316491) @@ -173,6 +173,9 @@ filter->status &= ~0xff; if (n < MBFL_WCSPLANE_UTF32MAX && (n < 0xd800 || n > 0xdfff)) { CK((*filter->output_function)(n, filter->data)); + } else { +n = (n & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; +CK((*filter->output_function)(n, filter->data)); } } break; @@ -205,6 +208,9 @@ n = (c & 0xff) | filter->cache; if (n < MBFL_WCSPLANE_UTF32MAX && (n < 0xd800 || n > 0xdfff)) { CK((*filter->output_function)(n, filter->data)); + } else { + n = (n & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(n, filter->data)); } } return c; @@ -253,7 +259,10 @@ n = ((c & 0xff) << 24) | filter->cache; if (n < MBFL_WCSPLANE_UTF32MAX && (n < 0xd800 || n > 0xdfff)) { CK((*filter->output_function)(n, filter->data)); - } + } else { + n = (n & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(n, filter->data)); + } } return c; } Modified: php/php-src/trunk/ext/mbstring/mbstring.c === --- php/php-src/trunk/ext/mbstring/mbstring.c 2011-09-11 11:28:12 UTC (rev 316490) +++ php/php-src/trunk/ext/mbstring/mbstring.c 2011-09-11 12:12:24 UTC (rev 316491) @@ -2025,7 +2025,7 @@ #define IS_SJIS1(c) c)>=0x81 && (c)<=0x9f) || ((c)>=0xe0 && (c)<=0xf5)) ? 1 : 0) #define IS_SJIS2(c) c)>=0x40 && (c)<=0x7e) || ((c)>=0x80 && (c)<=0xfc)) ? 1 : 0) -/* {{{ proto bool mb_parse_str(string encoded_string , array result) +/* {{{ proto bool mb_parse_str(string encoded_string [, array result]) Parses GET/POST/COOKIE data and sets global variables */ PHP_FUNCTION(mb_parse_str) { @@ -2036,12 +2036,12 @@ const mbfl_encoding *detected; track_vars_array = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &encstr, &encstr_len, &track_vars_array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &encstr, &encstr_len, &track_vars_array) == FAILURE) { return; } - /* Clear out the array */ if (track_vars_array != NULL) { + /* Clear out the array */ zval_dtor(track_vars_array); array_init(track_vars_array); } @@ -2057,7 +2057,16 @@ info.num_from_encodings = MBSTRG(http_input_list_size); info.from_language = MBSTRG(language); - detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr TSRMLS_CC); + if (track_vars_array != NULL) { + detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr TSRMLS_CC); + } else { + zval tmp; + if (!EG(active_symbol_table)) { + zend_rebuild_symbol_table(TSRMLS_C); + } + Z_ARRVAL(tmp) = EG(active_symbol_table); + detected = _php_mb_encoding_handler_ex(&info, &tmp, encstr TSRMLS_CC); + } MBSTRG(http_input_identify) = detected; Modified: php/php-src/trunk/ext/mbstring/tests/bug20087.phpt === --- php/php-src/trunk/ext/mbstring/tests/bug20087.phpt 2011-09-11 11:28:12 UTC (rev 316490) +++ php/php-src/trunk/ext/mbstring/tests/bug20087.phpt 2011-09-11 12:12:24 UTC (rev 316491) @@ -2,7 +2,7 @@ Bug #20087 (Assertion failure) --SKIPIF-- ---XFAIL-- +--FAIL-- register_globals calls killed the ability for mb_parse_str() to register into the global scope --FILE-- --EXPECT-- -8101 +8085 63 Modified: php/php-src/trunk/ext/mbstring/tests/bug49536.phpt === --- php/php-src/trunk/ext/mbstring/tests/bug49536.phpt 2011-09-11 11:28:12 UTC (rev 316490) +++ php/php-src/trunk/ext/mbstring/tests/bug49536.phpt 2011-09-11 12:12:24 UTC (rev 316491) @@ -16,5 +16,5 @@ --EXPECT-- string(4) "SJIS" bool(false) -string(5) "UTF-8" bool(false) +bool(false) Modified: php/php-src/trunk/ext/mbstring/tests/illformed_utf_sequences.phpt === --- php/php-src/trunk/ext/mbstring/tests/illformed_utf_sequences
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ libmbfl/filters/mbfilter_utf32.c mbstring.c tests/bug20087.phpt tests/bug28220.phpt tests/bug49536.phpt tests/illformed_utf_sequences.phpt te
hirokawa Sun, 11 Sep 2011 12:12:48 + Revision: http://svn.php.net/viewvc?view=revision&revision=316492 Log: MFH: fixed test case failures. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf32.c U php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c U php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug28220.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug49536.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/illformed_utf_sequences.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_parse_str02.phpt Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf32.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf32.c 2011-09-11 12:12:24 UTC (rev 316491) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf32.c 2011-09-11 12:12:48 UTC (rev 316492) @@ -173,6 +173,9 @@ filter->status &= ~0xff; if (n < MBFL_WCSPLANE_UTF32MAX && (n < 0xd800 || n > 0xdfff)) { CK((*filter->output_function)(n, filter->data)); + } else { +n = (n & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; +CK((*filter->output_function)(n, filter->data)); } } break; @@ -205,6 +208,9 @@ n = (c & 0xff) | filter->cache; if (n < MBFL_WCSPLANE_UTF32MAX && (n < 0xd800 || n > 0xdfff)) { CK((*filter->output_function)(n, filter->data)); + } else { + n = (n & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(n, filter->data)); } } return c; @@ -253,7 +259,10 @@ n = ((c & 0xff) << 24) | filter->cache; if (n < MBFL_WCSPLANE_UTF32MAX && (n < 0xd800 || n > 0xdfff)) { CK((*filter->output_function)(n, filter->data)); - } + } else { + n = (n & MBFL_WCSGROUP_MASK) | MBFL_WCSGROUP_THROUGH; + CK((*filter->output_function)(n, filter->data)); + } } return c; } Modified: php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c 2011-09-11 12:12:24 UTC (rev 316491) +++ php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c 2011-09-11 12:12:48 UTC (rev 316492) @@ -2025,7 +2025,7 @@ #define IS_SJIS1(c) c)>=0x81 && (c)<=0x9f) || ((c)>=0xe0 && (c)<=0xf5)) ? 1 : 0) #define IS_SJIS2(c) c)>=0x40 && (c)<=0x7e) || ((c)>=0x80 && (c)<=0xfc)) ? 1 : 0) -/* {{{ proto bool mb_parse_str(string encoded_string , array result) +/* {{{ proto bool mb_parse_str(string encoded_string [, array result]) Parses GET/POST/COOKIE data and sets global variables */ PHP_FUNCTION(mb_parse_str) { @@ -2036,12 +2036,12 @@ const mbfl_encoding *detected; track_vars_array = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &encstr, &encstr_len, &track_vars_array) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &encstr, &encstr_len, &track_vars_array) == FAILURE) { return; } - /* Clear out the array */ if (track_vars_array != NULL) { + /* Clear out the array */ zval_dtor(track_vars_array); array_init(track_vars_array); } @@ -2057,7 +2057,16 @@ info.num_from_encodings = MBSTRG(http_input_list_size); info.from_language = MBSTRG(language); - detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr TSRMLS_CC); + if (track_vars_array != NULL) { + detected = _php_mb_encoding_handler_ex(&info, track_vars_array, encstr TSRMLS_CC); + } else { + zval tmp; + if (!EG(active_symbol_table)) { + zend_rebuild_symbol_table(TSRMLS_C); + } + Z_ARRVAL(tmp) = EG(active_symbol_table); + detected = _php_mb_encoding_handler_ex(&info, &tmp, encstr TSRMLS_CC); + } MBSTRG(http_input_identify) = detected; Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt 2011-09-11 12:12:24 UTC (rev 316491) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug20087.phpt 2011-09-11 12:12:48 UTC (rev 316492) @@ -2,7 +2,7 @@ Bug #20087 (Assertion failure) --SKIPIF-- ---XFAIL-- +--FAIL-- register_globals calls killed the ability for mb_parse_str() to register into the global scope --FILE-- --EXPECT-- -8101 +8085 63 Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug49536.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug49536.phpt 2011-09-11 12:12:24 UTC (rev 316491) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug49536.phpt 2011-09-11 12:12:48 UTC (rev 316492) @@ -16,5 +16,5 @@ --EXPECT-- string(4) "SJIS" bool(false) -string(5) "UTF-8" bool(fa
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ mb_ereg_search_pos.phpt
hirokawa Sun, 11 Sep 2011 12:29:00 + Revision: http://svn.php.net/viewvc?view=revision&revision=316493 Log: fixed test case failures. Changed paths: U php/php-src/trunk/ext/mbstring/tests/mb_ereg_search_pos.phpt Modified: php/php-src/trunk/ext/mbstring/tests/mb_ereg_search_pos.phpt === --- php/php-src/trunk/ext/mbstring/tests/mb_ereg_search_pos.phpt 2011-09-11 12:12:48 UTC (rev 316492) +++ php/php-src/trunk/ext/mbstring/tests/mb_ereg_search_pos.phpt 2011-09-11 12:29:00 UTC (rev 316493) @@ -6,7 +6,7 @@ ?> --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/tests/ mb_ereg_search_pos.phpt
hirokawa Sun, 11 Sep 2011 12:29:15 + Revision: http://svn.php.net/viewvc?view=revision&revision=316494 Log: MFH: fixed test case failures. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_ereg_search_pos.phpt Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_ereg_search_pos.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_ereg_search_pos.phpt 2011-09-11 12:29:00 UTC (rev 316493) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_ereg_search_pos.phpt 2011-09-11 12:29:15 UTC (rev 316494) @@ -6,7 +6,7 @@ ?> --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ mb_send_mail01.phpt mb_send_mail02.phpt mb_send_mail03.phpt mb_send_mail04.phpt mb_send_mail05.phpt mb_send_mail06.phpt mb_send_mail07.phpt
hirokawa Sun, 11 Sep 2011 13:04:21 + Revision: http://svn.php.net/viewvc?view=revision&revision=316495 Log: fixed test failure on win32. Changed paths: U php/php-src/trunk/ext/mbstring/tests/mb_send_mail01.phpt U php/php-src/trunk/ext/mbstring/tests/mb_send_mail02.phpt U php/php-src/trunk/ext/mbstring/tests/mb_send_mail03.phpt U php/php-src/trunk/ext/mbstring/tests/mb_send_mail04.phpt U php/php-src/trunk/ext/mbstring/tests/mb_send_mail05.phpt U php/php-src/trunk/ext/mbstring/tests/mb_send_mail06.phpt U php/php-src/trunk/ext/mbstring/tests/mb_send_mail07.phpt Modified: php/php-src/trunk/ext/mbstring/tests/mb_send_mail01.phpt === --- php/php-src/trunk/ext/mbstring/tests/mb_send_mail01.phpt2011-09-11 12:29:15 UTC (rev 316494) +++ php/php-src/trunk/ext/mbstring/tests/mb_send_mail01.phpt2011-09-11 13:04:21 UTC (rev 316495) @@ -2,6 +2,9 @@ mb_send_mail() test 1 (lang=neutral) --SKIPIF-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/tests/ mb_send_mail01.phpt mb_send_mail02.phpt mb_send_mail03.phpt mb_send_mail04.phpt mb_send_mail05.phpt mb_send_mail06.phpt mb_send_mail07.
hirokawa Sun, 11 Sep 2011 13:04:38 + Revision: http://svn.php.net/viewvc?view=revision&revision=316496 Log: MFH: fixed test failure on win32. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail01.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail02.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail03.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail04.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail05.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail06.phpt U php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail07.phpt Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail01.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail01.phpt 2011-09-11 13:04:21 UTC (rev 316495) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail01.phpt 2011-09-11 13:04:38 UTC (rev 316496) @@ -2,6 +2,9 @@ mb_send_mail() test 1 (lang=neutral) --SKIPIF-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ bug52861.phpt
hirokawa Sun, 11 Sep 2011 13:15:40 + Revision: http://svn.php.net/viewvc?view=revision&revision=316497 Log: MFH: fixed test failure on win32. Changed paths: U php/php-src/trunk/ext/mbstring/tests/bug52861.phpt Modified: php/php-src/trunk/ext/mbstring/tests/bug52861.phpt === --- php/php-src/trunk/ext/mbstring/tests/bug52861.phpt 2011-09-11 13:04:38 UTC (rev 316496) +++ php/php-src/trunk/ext/mbstring/tests/bug52861.phpt 2011-09-11 13:15:40 UTC (rev 316497) @@ -2,6 +2,9 @@ Bug #52681 (mb_send_mail() appends an extra MIME-Version header) --SKIPIF-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/tests/ bug52861.phpt
hirokawa Sun, 11 Sep 2011 13:15:48 + Revision: http://svn.php.net/viewvc?view=revision&revision=316498 Log: MFH: fixed test failure on win32. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug52861.phpt Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug52861.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug52861.phpt 2011-09-11 13:15:40 UTC (rev 316497) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug52861.phpt 2011-09-11 13:15:48 UTC (rev 316498) @@ -2,6 +2,9 @@ Bug #52681 (mb_send_mail() appends an extra MIME-Version header) --SKIPIF-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ mbstring.c
hirokawa Mon, 12 Sep 2011 13:20:05 + Revision: http://svn.php.net/viewvc?view=revision&revision=316534 Log: fixed optional argument. Changed paths: U php/php-src/trunk/ext/mbstring/mbstring.c Modified: php/php-src/trunk/ext/mbstring/mbstring.c === --- php/php-src/trunk/ext/mbstring/mbstring.c 2011-09-12 13:14:16 UTC (rev 316533) +++ php/php-src/trunk/ext/mbstring/mbstring.c 2011-09-12 13:20:05 UTC (rev 316534) @@ -245,7 +245,7 @@ ZEND_ARG_INFO(0, encoding) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_parse_str, 0, 0, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_parse_str, 0, 0, 1) ZEND_ARG_INFO(0, encoded_string) ZEND_ARG_INFO(1, result) ZEND_END_ARG_INFO() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ mbstring.c
hirokawa Mon, 12 Sep 2011 13:20:27 + Revision: http://svn.php.net/viewvc?view=revision&revision=316535 Log: MFH: fixed optional argument. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c2011-09-12 13:20:05 UTC (rev 316534) +++ php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c2011-09-12 13:20:27 UTC (rev 316535) @@ -245,7 +245,7 @@ ZEND_ARG_INFO(0, encoding) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_parse_str, 0, 0, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_parse_str, 0, 0, 1) ZEND_ARG_INFO(0, encoded_string) ZEND_ARG_INFO(1, result) ZEND_END_ARG_INFO() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.c
hirokawa Fri, 23 Sep 2011 11:08:34 + Revision: http://svn.php.net/viewvc?view=revision&revision=317186 Log: fixed a bug in conversion table. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-09-23 10:06:48 UTC (rev 317185) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-09-23 11:08:34 UTC (rev 317186) @@ -176,7 +176,7 @@ {0x2921, 0x297a, 0xe001}, {0x2980, 0x29cc, 0xe301}, {0x2a99, 0x2ae4, 0xe401}, - {0x2af8, 0x2b2e, 0xe501}, + {0x2af8, 0x2b2f, 0xe501}, }; const unsigned short mbfl_kddi2uni_pua_b[8][3] = { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ pictogram1.phpt
hirokawa Fri, 23 Sep 2011 11:09:33 + Revision: http://svn.php.net/viewvc?view=revision&revision=317187 Log: added test script for pictogram. Changed paths: A php/php-src/trunk/ext/mbstring/tests/pictogram1.phpt Added: php/php-src/trunk/ext/mbstring/tests/pictogram1.phpt === --- php/php-src/trunk/ext/mbstring/tests/pictogram1.phpt (rev 0) +++ php/php-src/trunk/ext/mbstring/tests/pictogram1.phpt 2011-09-23 11:09:33 UTC (rev 317187) @@ -0,0 +1,172 @@ +--TEST-- +Emoji (Pictogram characters for cellular phone in Japan) test based on Unicode 6.0 +--SKIPIF-- + +--FILE-- + +--EXPECT-- +SJIS-Mobile to Unicode +string(8) "2600" +string(8) "2600" +string(8) "2600" +string(8) "0001f340" +string(8) "0001f340" +string(8) "0001f340" +string(16) "002320e3" +string(16) "002320e3" +string(16) "002320e3" +string(16) "0001f1e80001f1f3" +string(16) "0001f1e80001f1f3" +Unicode to SJIS-Mobile +string(4) "f89f" +string(4) "f660" +string(4) "f98b" +string(4) "f9e6" +string(4) "f6ec" +string(4) "f750" +string(4) "f985" +string(4) "f489" +string(4) "f7b0" +string(4) "3f3f" +string(4) "f3d2" +string(4) "fbb3" +UTF-8-Mobile to Unicode +string(8) "2600" +string(8) "2600" +string(8) "2600" +string(8) "0001f340" +string(8) "0001f340" +string(8) "0001f340" +string(16) "002320e3" +string(16) "002320e3" +string(16) "002320e3" +string(16) "0001f1e80001f1f3" +string(16) "0001f1e80001f1f3" +Unicode to UTF8-Mobile +string(6) "ee98be" +string(6) "eebda0" +string(6) "ee818a" +string(6) "ee9d81" +string(6) "eebfac" +string(6) "ee8490" +string(6) "ee9ba0" +string(6) "eeb689" +string(6) "ee8890" +string(16) "f09f87a8f09f87b3" +string(6) "eeb392" +string(6) "ee9493" +Unicode to ISO-2022-JP-MOBILE#KDDI +string(16) "1b244275411b2842" +ISO-2022-JP-MOBILE#KDDI to Unicode +string(8) "2600" +SJIS-Mobile to Unicode (Google) +string(8) "000fe82d" +string(8) "000fe82d" +string(8) "000fee70" +Unicode (Google) to SJIS-Mobile +string(4) "f986" +string(4) "f748" +string(4) "fbd8" +UTF-8-Mobile to Unicode (Google) +string(8) "000fe82d" +string(8) "000fe82d" +string(8) "000fee70" +Unicode (Google) to UTF-8-Mobile +string(6) "ee9ba1" +string(6) "ef8188" +string(6) "ee94b8" Property changes on: php/php-src/trunk/ext/mbstring/tests/pictogram1.phpt ___ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ libmbfl/filters/mbfilter_sjis_mobile.c tests/pictogram1.phpt
hirokawa Fri, 23 Sep 2011 11:11:38 + Revision: http://svn.php.net/viewvc?view=revision&revision=317188 Log: MFH: fixed a bug in convertion table and added test script for emoji. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c A php/php-src/branches/PHP_5_4/ext/mbstring/tests/pictogram1.phpt Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-09-23 11:09:33 UTC (rev 317187) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c 2011-09-23 11:11:38 UTC (rev 317188) @@ -176,7 +176,7 @@ {0x2921, 0x297a, 0xe001}, {0x2980, 0x29cc, 0xe301}, {0x2a99, 0x2ae4, 0xe401}, - {0x2af8, 0x2b2e, 0xe501}, + {0x2af8, 0x2b2f, 0xe501}, }; const unsigned short mbfl_kddi2uni_pua_b[8][3] = { Added: php/php-src/branches/PHP_5_4/ext/mbstring/tests/pictogram1.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/pictogram1.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/pictogram1.phpt 2011-09-23 11:11:38 UTC (rev 317188) @@ -0,0 +1,172 @@ +--TEST-- +Emoji (Pictogram characters for cellular phone in Japan) test based on Unicode 6.0 +--SKIPIF-- + +--FILE-- + +--EXPECT-- +SJIS-Mobile to Unicode +string(8) "2600" +string(8) "2600" +string(8) "2600" +string(8) "0001f340" +string(8) "0001f340" +string(8) "0001f340" +string(16) "002320e3" +string(16) "002320e3" +string(16) "002320e3" +string(16) "0001f1e80001f1f3" +string(16) "0001f1e80001f1f3" +Unicode to SJIS-Mobile +string(4) "f89f" +string(4) "f660" +string(4) "f98b" +string(4) "f9e6" +string(4) "f6ec" +string(4) "f750" +string(4) "f985" +string(4) "f489" +string(4) "f7b0" +string(4) "3f3f" +string(4) "f3d2" +string(4) "fbb3" +UTF-8-Mobile to Unicode +string(8) "2600" +string(8) "2600" +string(8) "2600" +string(8) "0001f340" +string(8) "0001f340" +string(8) "0001f340" +string(16) "002320e3" +string(16) "002320e3" +string(16) "002320e3" +string(16) "0001f1e80001f1f3" +string(16) "0001f1e80001f1f3" +Unicode to UTF8-Mobile +string(6) "ee98be" +string(6) "eebda0" +string(6) "ee818a" +string(6) "ee9d81" +string(6) "eebfac" +string(6) "ee8490" +string(6) "ee9ba0" +string(6) "eeb689" +string(6) "ee8890" +string(16) "f09f87a8f09f87b3" +string(6) "eeb392" +string(6) "ee9493" +Unicode to ISO-2022-JP-MOBILE#KDDI +string(16) "1b244275411b2842" +ISO-2022-JP-MOBILE#KDDI to Unicode +string(8) "2600" +SJIS-Mobile to Unicode (Google) +string(8) "000fe82d" +string(8) "000fe82d" +string(8) "000fee70" +Unicode (Google) to SJIS-Mobile +string(4) "f986" +string(4) "f748" +string(4) "fbd8" +UTF-8-Mobile to Unicode (Google) +string(8) "000fe82d" +string(8) "000fe82d" +string(8) "000fee70" +Unicode (Google) to UTF-8-Mobile +string(6) "ee9ba1" +string(6) "ef8188" +string(6) "ee94b8" Property changes on: php/php-src/branches/PHP_5_4/ext/mbstring/tests/pictogram1.phpt ___ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/mbfl/ mbfilter.c
hirokawa Sat, 24 Sep 2011 02:11:18 + Revision: http://svn.php.net/viewvc?view=revision&revision=317229 Log: fixed #40685: removed '&' in mb_decode_numericentity(). Bug: https://bugs.php.net/40685 (Bogus) '&&&' => '&&' at mb_decode_numericentity Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c === --- php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c 2011-09-24 01:34:46 UTC (rev 317228) +++ php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c 2011-09-24 02:11:18 UTC (rev 317229) @@ -2954,6 +2954,80 @@ return c; } +int mbfl_filt_decode_htmlnumericentity_flush(mbfl_convert_filter *filter) +{ + struct collector_htmlnumericentity_data *pc = (struct collector_htmlnumericentity_data *)filter; + int n, s, r, d; + + if (pc->status) { + switch (pc->status) { + case 1: /* '&' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + break; + case 2: /* '#' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + break; + case 3: /* '0'-'9' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + + s = pc->cache; + r = 1; + n = pc->digit; + while (n > 0) { + r *= 10; + n--; + } + s %= r; + r /= 10; + while (r > 0) { + d = s/r; + s %= r; + r /= 10; + (*pc->decoder->filter_function)(mbfl_hexchar_table[d], pc->decoder); + } + + break; + case 4: /* 'x' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + (*pc->decoder->filter_function)(0x78, pc->decoder); /* 'x' */ + break; + case 5: /* '0'-'9','a'-'f' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + (*pc->decoder->filter_function)(0x78, pc->decoder); /* 'x' */ + + s = pc->cache; + r = 1; + n = pc->digit; + while (n > 0) { + r *= 16; + n--; + } + s %= r; + r /= 16; + while (r > 0) { + d = s/r; + s %= r; + r /= 16; + (*pc->decoder->filter_function)(mbfl_hexchar_table[d], pc->decoder); + } + break; + default: + break; + } + } + + pc->status = 0; + pc->cache = 0; + pc->digit = 0; + + return 0; +} + + mbfl_string * mbfl_html_numeric_entity( mbfl_string *string, @@ -2996,7 +3070,8 @@ encoder = mbfl_convert_filter_new( string->no_encoding, mbfl_no_encoding_wchar, - collector_decode_htmlnumericentity, 0, &pc); + collector_decode_htmlnumericentity, + (int (*)(void*))mbfl_filt_decode_htmlnumericentity_flush, &pc); } if (pc.decoder == NULL || encoder == NULL) { mbfl_convert_filter_delete(encoder); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ bug40685.phpt
hirokawa Sat, 24 Sep 2011 02:11:48 + Revision: http://svn.php.net/viewvc?view=revision&revision=317230 Log: added tests for #40685. Bug: https://bugs.php.net/40685 (Bogus) '&&&' => '&&' at mb_decode_numericentity Changed paths: A php/php-src/trunk/ext/mbstring/tests/bug40685.phpt Added: php/php-src/trunk/ext/mbstring/tests/bug40685.phpt === --- php/php-src/trunk/ext/mbstring/tests/bug40685.phpt (rev 0) +++ php/php-src/trunk/ext/mbstring/tests/bug40685.phpt 2011-09-24 02:11:48 UTC (rev 317230) @@ -0,0 +1,25 @@ +--TEST-- +Bug #40685 (mb_decode_numericentity() removes '&' in the string) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +string(1) "&" +string(3) "&&&" +string(2) "" +string(3) "" +string(4) "=" +string(5) "=" +string(1) "=" +string(1) "=" Property changes on: php/php-src/trunk/ext/mbstring/tests/bug40685.phpt ___ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ libmbfl/mbfl/mbfilter.c tests/bug40685.phpt
hirokawa Sat, 24 Sep 2011 02:12:17 + Revision: http://svn.php.net/viewvc?view=revision&revision=317231 Log: MFH: fixed #40685: removed '&' in mb_decode_numericentity(). Bug: https://bugs.php.net/40685 (Bogus) '&&&' => '&&' at mb_decode_numericentity Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.c A php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug40685.phpt Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.c 2011-09-24 02:11:48 UTC (rev 317230) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/mbfl/mbfilter.c 2011-09-24 02:12:17 UTC (rev 317231) @@ -2954,6 +2954,80 @@ return c; } +int mbfl_filt_decode_htmlnumericentity_flush(mbfl_convert_filter *filter) +{ + struct collector_htmlnumericentity_data *pc = (struct collector_htmlnumericentity_data *)filter; + int n, s, r, d; + + if (pc->status) { + switch (pc->status) { + case 1: /* '&' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + break; + case 2: /* '#' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + break; + case 3: /* '0'-'9' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + + s = pc->cache; + r = 1; + n = pc->digit; + while (n > 0) { + r *= 10; + n--; + } + s %= r; + r /= 10; + while (r > 0) { + d = s/r; + s %= r; + r /= 10; + (*pc->decoder->filter_function)(mbfl_hexchar_table[d], pc->decoder); + } + + break; + case 4: /* 'x' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + (*pc->decoder->filter_function)(0x78, pc->decoder); /* 'x' */ + break; + case 5: /* '0'-'9','a'-'f' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + (*pc->decoder->filter_function)(0x78, pc->decoder); /* 'x' */ + + s = pc->cache; + r = 1; + n = pc->digit; + while (n > 0) { + r *= 16; + n--; + } + s %= r; + r /= 16; + while (r > 0) { + d = s/r; + s %= r; + r /= 16; + (*pc->decoder->filter_function)(mbfl_hexchar_table[d], pc->decoder); + } + break; + default: + break; + } + } + + pc->status = 0; + pc->cache = 0; + pc->digit = 0; + + return 0; +} + + mbfl_string * mbfl_html_numeric_entity( mbfl_string *string, @@ -2996,7 +3070,8 @@ encoder = mbfl_convert_filter_new( string->no_encoding, mbfl_no_encoding_wchar, - collector_decode_htmlnumericentity, 0, &pc); + collector_decode_htmlnumericentity, + (int (*)(void*))mbfl_filt_decode_htmlnumericentity_flush, &pc); } if (pc.decoder == NULL || encoder == NULL) { mbfl_convert_filter_delete(encoder); Added: php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug40685.phpt === --- php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug40685.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug40685.phpt 2011-09-24 02:12:17 UTC (rev 317231) @@ -0,0 +1,25 @@ +--TEST-- +Bug #40685 (mb_decode_numericentity() removes '&' in the string) +--SKIPIF-- + +--FILE-- + +
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mbstring/ libmbfl/mbfl/mbfilter.c tests/bug40685.phpt
hirokawa Sat, 24 Sep 2011 02:20:38 + Revision: http://svn.php.net/viewvc?view=revision&revision=317232 Log: MFH: fixed #40685: removed '&' in mb_decode_numericentity(). Bug: https://bugs.php.net/40685 (Bogus) '&&&' => '&&' at mb_decode_numericentity Changed paths: U php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c A php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug40685.phpt Modified: php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c === --- php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c 2011-09-24 02:12:17 UTC (rev 317231) +++ php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c 2011-09-24 02:20:38 UTC (rev 317232) @@ -2702,6 +2702,53 @@ return c; } +int mbfl_filt_decode_htmlnumericentity_flush(mbfl_convert_filter *filter) +{ + struct collector_htmlnumericentity_data *pc = (struct collector_htmlnumericentity_data *)filter; + int n, s, r, d; + + if (pc->status) { + switch (pc->status) { + case 1: /* '&' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + break; + case 2: /* '#' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + break; + case 3: /* '0'-'9' */ + (*pc->decoder->filter_function)(0x26, pc->decoder); /* '&' */ + (*pc->decoder->filter_function)(0x23, pc->decoder); /* '#' */ + + s = pc->cache; + r = 1; + n = pc->digit; + while (n > 0) { + r *= 10; + n--; + } + s %= r; + r /= 10; + while (r > 0) { + d = s/r; + s %= r; + r /= 10; + (*pc->decoder->filter_function)(mbfl_hexchar_table[d], pc->decoder); + } + + break; + default: + break; + } + } + + pc->status = 0; + pc->cache = 0; + pc->digit = 0; + + return 0; +} + mbfl_string * mbfl_html_numeric_entity( mbfl_string *string, @@ -2739,7 +2786,8 @@ encoder = mbfl_convert_filter_new( string->no_encoding, mbfl_no_encoding_wchar, - collector_decode_htmlnumericentity, 0, &pc); + collector_decode_htmlnumericentity, + (int (*)(void*))mbfl_filt_decode_htmlnumericentity_flush, &pc); } if (pc.decoder == NULL || encoder == NULL) { mbfl_convert_filter_delete(encoder); Added: php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug40685.phpt === --- php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug40685.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug40685.phpt 2011-09-24 02:20:38 UTC (rev 317232) @@ -0,0 +1,20 @@ +--TEST-- +Bug #40685 (mb_decode_numericentity() removes '&' in the string) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +string(1) "&" +string(3) "&&&" +string(2) "" +string(4) "=" +string(1) "=" + Property changes on: php/php-src/branches/PHP_5_3/ext/mbstring/tests/bug40685.phpt ___ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ mbstring.c php_mbregex.c php_mbregex.h
hirokawa Sun, 25 Sep 2011 08:01:54 + Revision: http://svn.php.net/viewvc?view=revision&revision=317262 Log: added mb_ereg_replace_callback(). Changed paths: U php/php-src/trunk/ext/mbstring/mbstring.c U php/php-src/trunk/ext/mbstring/php_mbregex.c U php/php-src/trunk/ext/mbstring/php_mbregex.h Modified: php/php-src/trunk/ext/mbstring/mbstring.c === --- php/php-src/trunk/ext/mbstring/mbstring.c 2011-09-25 07:23:54 UTC (rev 317261) +++ php/php-src/trunk/ext/mbstring/mbstring.c 2011-09-25 08:01:54 UTC (rev 317262) @@ -467,6 +467,13 @@ ZEND_ARG_INFO(0, string) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_ereg_replace_callback, 0, 0, 3) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, callback) + ZEND_ARG_INFO(0, string) + ZEND_ARG_INFO(0, option) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_split, 0, 0, 2) ZEND_ARG_INFO(0, pattern) ZEND_ARG_INFO(0, string) Modified: php/php-src/trunk/ext/mbstring/php_mbregex.c === --- php/php-src/trunk/ext/mbstring/php_mbregex.c2011-09-25 07:23:54 UTC (rev 317261) +++ php/php-src/trunk/ext/mbstring/php_mbregex.c2011-09-25 08:01:54 UTC (rev 317262) @@ -784,7 +784,7 @@ /* }}} */ /* {{{ _php_mb_regex_ereg_replace_exec */ -static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOptionType options) +static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOptionType options, int is_callable) { zval **arg_pattern_zval; @@ -793,9 +793,11 @@ char *replace; int replace_len; + zval **arg_replace_zval; char *string; int string_len; + zval **arg_string_zval; char *p; php_mb_regex_t *re; @@ -826,14 +828,20 @@ char *option_str = NULL; int option_str_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zss|s", - &arg_pattern_zval, - &replace, &replace_len, - &string, &string_len, - &option_str, &option_str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ|s", + &arg_pattern_zval, + &arg_replace_zval, + &arg_string_zval, + &option_str, &option_str_len) == FAILURE) { RETURN_FALSE; } + replace = Z_STRVAL_PP(arg_replace_zval); + replace_len = Z_STRLEN_PP(arg_replace_zval); + + string = Z_STRVAL_PP(arg_string_zval); + string_len = Z_STRLEN_PP(arg_string_zval); + if (option_str != NULL) { _php_mb_regex_init_options(option_str, option_str_len, &options, &syntax, &eval); } else { @@ -859,7 +867,7 @@ RETURN_FALSE; } - if (eval) { + if (eval || is_callable) { pbuf = &eval_buf; description = zend_make_compiled_string_description("mbregex replace" TSRMLS_CC); } else { @@ -867,6 +875,22 @@ description = NULL; } + if (is_callable) { + char *callback_name; + if (!zend_is_callable(*arg_replace_zval, 0, &callback_name TSRMLS_CC)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires argument 2, '%s', to be a valid callback", callback_name); + efree(callback_name); + MAKE_COPY_ZVAL(arg_string_zval, return_value); + RETURN_FALSE; + } + efree(callback_name); + + if (eval) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option 'e' cannot be used with replacement callback"); + RETURN_FALSE; + } + } + /* do the actual work */ err = 0; pos = (OnigUChar *)string; @@ -911,6 +935,8 @@ i += fwd; } } + + if (eval) { zval v; /* null terminate buffer */ @@ -928,7 +954,38 @@ /* Clean up */ eval_buf.len = 0; zval_
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ mbstring.c php_mbregex.c php_mbregex.h
hirokawa Sun, 25 Sep 2011 08:15:50 + Revision: http://svn.php.net/viewvc?view=revision&revision=317263 Log: MFH: added mb_ereg_replace_callback(). Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c U php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c U php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.h Modified: php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c2011-09-25 08:01:54 UTC (rev 317262) +++ php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c2011-09-25 08:15:50 UTC (rev 317263) @@ -467,6 +467,13 @@ ZEND_ARG_INFO(0, string) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_ereg_replace_callback, 0, 0, 3) + ZEND_ARG_INFO(0, pattern) + ZEND_ARG_INFO(0, callback) + ZEND_ARG_INFO(0, string) + ZEND_ARG_INFO(0, option) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_split, 0, 0, 2) ZEND_ARG_INFO(0, pattern) ZEND_ARG_INFO(0, string) Modified: php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c 2011-09-25 08:01:54 UTC (rev 317262) +++ php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c 2011-09-25 08:15:50 UTC (rev 317263) @@ -784,7 +784,7 @@ /* }}} */ /* {{{ _php_mb_regex_ereg_replace_exec */ -static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOptionType options) +static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOptionType options, int is_callable) { zval **arg_pattern_zval; @@ -793,9 +793,11 @@ char *replace; int replace_len; + zval **arg_replace_zval; char *string; int string_len; + zval **arg_string_zval; char *p; php_mb_regex_t *re; @@ -826,14 +828,20 @@ char *option_str = NULL; int option_str_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zss|s", - &arg_pattern_zval, - &replace, &replace_len, - &string, &string_len, - &option_str, &option_str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ|s", + &arg_pattern_zval, + &arg_replace_zval, + &arg_string_zval, + &option_str, &option_str_len) == FAILURE) { RETURN_FALSE; } + replace = Z_STRVAL_PP(arg_replace_zval); + replace_len = Z_STRLEN_PP(arg_replace_zval); + + string = Z_STRVAL_PP(arg_string_zval); + string_len = Z_STRLEN_PP(arg_string_zval); + if (option_str != NULL) { _php_mb_regex_init_options(option_str, option_str_len, &options, &syntax, &eval); } else { @@ -859,7 +867,7 @@ RETURN_FALSE; } - if (eval) { + if (eval || is_callable) { pbuf = &eval_buf; description = zend_make_compiled_string_description("mbregex replace" TSRMLS_CC); } else { @@ -867,6 +875,22 @@ description = NULL; } + if (is_callable) { + char *callback_name; + if (!zend_is_callable(*arg_replace_zval, 0, &callback_name TSRMLS_CC)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires argument 2, '%s', to be a valid callback", callback_name); + efree(callback_name); + MAKE_COPY_ZVAL(arg_string_zval, return_value); + RETURN_FALSE; + } + efree(callback_name); + + if (eval) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option 'e' cannot be used with replacement callback"); + RETURN_FALSE; + } + } + /* do the actual work */ err = 0; pos = (OnigUChar *)string; @@ -911,6 +935,8 @@ i += fwd; } } + + if (eval) { zval v; /* null terminate buffer */ @@ -928,7 +954,38 @@
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ mbstring.c php_mbregex.c php_mbregex.h
hirokawa Sun, 25 Sep 2011 08:22:58 + Revision: http://svn.php.net/viewvc?view=revision&revision=317264 Log: revert the previous patch. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c U php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c U php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.h Modified: php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c2011-09-25 08:15:50 UTC (rev 317263) +++ php/php-src/branches/PHP_5_4/ext/mbstring/mbstring.c2011-09-25 08:22:58 UTC (rev 317264) @@ -467,13 +467,6 @@ ZEND_ARG_INFO(0, string) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_ereg_replace_callback, 0, 0, 3) - ZEND_ARG_INFO(0, pattern) - ZEND_ARG_INFO(0, callback) - ZEND_ARG_INFO(0, string) - ZEND_ARG_INFO(0, option) -ZEND_END_ARG_INFO() - ZEND_BEGIN_ARG_INFO_EX(arginfo_mb_split, 0, 0, 2) ZEND_ARG_INFO(0, pattern) ZEND_ARG_INFO(0, string) Modified: php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c 2011-09-25 08:15:50 UTC (rev 317263) +++ php/php-src/branches/PHP_5_4/ext/mbstring/php_mbregex.c 2011-09-25 08:22:58 UTC (rev 317264) @@ -784,7 +784,7 @@ /* }}} */ /* {{{ _php_mb_regex_ereg_replace_exec */ -static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOptionType options, int is_callable) +static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOptionType options) { zval **arg_pattern_zval; @@ -793,11 +793,9 @@ char *replace; int replace_len; - zval **arg_replace_zval; char *string; int string_len; - zval **arg_string_zval; char *p; php_mb_regex_t *re; @@ -828,20 +826,14 @@ char *option_str = NULL; int option_str_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ|s", - &arg_pattern_zval, - &arg_replace_zval, - &arg_string_zval, - &option_str, &option_str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zss|s", + &arg_pattern_zval, + &replace, &replace_len, + &string, &string_len, + &option_str, &option_str_len) == FAILURE) { RETURN_FALSE; } - replace = Z_STRVAL_PP(arg_replace_zval); - replace_len = Z_STRLEN_PP(arg_replace_zval); - - string = Z_STRVAL_PP(arg_string_zval); - string_len = Z_STRLEN_PP(arg_string_zval); - if (option_str != NULL) { _php_mb_regex_init_options(option_str, option_str_len, &options, &syntax, &eval); } else { @@ -867,7 +859,7 @@ RETURN_FALSE; } - if (eval || is_callable) { + if (eval) { pbuf = &eval_buf; description = zend_make_compiled_string_description("mbregex replace" TSRMLS_CC); } else { @@ -875,22 +867,6 @@ description = NULL; } - if (is_callable) { - char *callback_name; - if (!zend_is_callable(*arg_replace_zval, 0, &callback_name TSRMLS_CC)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires argument 2, '%s', to be a valid callback", callback_name); - efree(callback_name); - MAKE_COPY_ZVAL(arg_string_zval, return_value); - RETURN_FALSE; - } - efree(callback_name); - - if (eval) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option 'e' cannot be used with replacement callback"); - RETURN_FALSE; - } - } - /* do the actual work */ err = 0; pos = (OnigUChar *)string; @@ -935,8 +911,6 @@ i += fwd; } } - - if (eval) { zval v; /* null terminate buffer */ @@ -954,38 +928,7 @@ /* Cle
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ php_mbregex.c
hirokawa Sun, 25 Sep 2011 08:33:43 + Revision: http://svn.php.net/viewvc?view=revision&revision=317265 Log: fixed seg faults for mb_ereg_replace_callback. Changed paths: U php/php-src/trunk/ext/mbstring/php_mbregex.c Modified: php/php-src/trunk/ext/mbstring/php_mbregex.c === --- php/php-src/trunk/ext/mbstring/php_mbregex.c2011-09-25 08:22:58 UTC (rev 317264) +++ php/php-src/trunk/ext/mbstring/php_mbregex.c2011-09-25 08:33:43 UTC (rev 317265) @@ -913,30 +913,32 @@ #endif /* copy the part of the string before the match */ smart_str_appendl(&out_buf, pos, (size_t)((OnigUChar *)(string + regs->beg[0]) - pos)); - /* copy replacement and backrefs */ - i = 0; - p = replace; - while (i < replace_len) { - int fwd = (int) php_mb_mbchar_bytes_ex(p, enc); - n = -1; - if ((replace_len - i) >= 2 && fwd == 1 && + + if (!is_callable) { + /* copy replacement and backrefs */ + i = 0; + p = replace; + while (i < replace_len) { + int fwd = (int) php_mb_mbchar_bytes_ex(p, enc); + n = -1; + if ((replace_len - i) >= 2 && fwd == 1 && p[0] == '\\' && p[1] >= '0' && p[1] <= '9') { - n = p[1] - '0'; - } - if (n >= 0 && n < regs->num_regs) { - if (regs->beg[n] >= 0 && regs->beg[n] < regs->end[n] && regs->end[n] <= string_len) { - smart_str_appendl(pbuf, string + regs->beg[n], regs->end[n] - regs->beg[n]); + n = p[1] - '0'; } - p += 2; - i += 2; - } else { - smart_str_appendl(pbuf, p, fwd); - p += fwd; - i += fwd; + if (n >= 0 && n < regs->num_regs) { + if (regs->beg[n] >= 0 && regs->beg[n] < regs->end[n] && regs->end[n] <= string_len) { + smart_str_appendl(pbuf, string + regs->beg[n], regs->end[n] - regs->beg[n]); + } + p += 2; + i += 2; + } else { + smart_str_appendl(pbuf, p, fwd); + p += fwd; + i += fwd; + } } } - - + if (eval) { zval v; /* null terminate buffer */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ mb_ereg_replace_callback.phpt
hirokawa Sun, 25 Sep 2011 08:55:27 + Revision: http://svn.php.net/viewvc?view=revision&revision=317266 Log: added test script for mb_ereg_replace_callback(). Changed paths: A php/php-src/trunk/ext/mbstring/tests/mb_ereg_replace_callback.phpt Added: php/php-src/trunk/ext/mbstring/tests/mb_ereg_replace_callback.phpt === --- php/php-src/trunk/ext/mbstring/tests/mb_ereg_replace_callback.phpt (rev 0) +++ php/php-src/trunk/ext/mbstring/tests/mb_ereg_replace_callback.phpt 2011-09-25 08:55:27 UTC (rev 317266) @@ -0,0 +1,15 @@ +--TEST-- +mb_ereg_replace_callback() +--SKIPIF-- + +--FILE-- + +--EXPECT-- +abc(3) 123(3) #",;(4) $foo(4) + Property changes on: php/php-src/trunk/ext/mbstring/tests/mb_ereg_replace_callback.phpt ___ Added: svn:keywords + Id Rev Revision Added: svn:eol-style + native -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ emoji2uni.h
hirokawa Sat, 15 Oct 2011 07:12:02 + Revision: http://svn.php.net/viewvc?view=revision&revision=318128 Log: added a missing emoji U+27BF. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/emoji2uni.h Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/emoji2uni.h === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/emoji2uni.h 2011-10-15 06:31:22 UTC (rev 318127) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/emoji2uni.h 2011-10-15 07:12:02 UTC (rev 318128) @@ -42,7 +42,7 @@ 0xEE11, 0x2709, 0xEE12, 0xEE13, 0xf4b4, 0xf193, 0xf194, 0xf511, 0x21a9, 0xf191, 0xf50d, 0xf195, - 0xf6a9, 0x, 0x0023, 0xE82D, + 0xf6a9, 0x27bf, 0x0023, 0xE82D, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0030, 0x2764, 0xf493, @@ -275,7 +275,7 @@ 0xf6a2, 0xf201, 0xf49f, 0x2734, 0x2733, 0xf51e, 0xf6ad, 0xf530, 0x267f, 0xf4f6, 0x2665, 0x2666, - 0x2660, 0x2663, 0x0023, 0x, + 0x2660, 0x2663, 0x0023, 0x27bf, 0xf195, 0xf199, 0xf192, 0xf236, 0xf21a, 0xf237, 0xf238, 0xf534, 0xf532, 0xf533, 0x0031, 0x0032, @@ -426,8 +426,8 @@ 0x26f5, 0x26fd, 0x2702, 0x2708, 0x2709, 0x270a, 0x270b, 0x270c, 0x270f, 0x2712, 0x2728, 0x2757, - 0x2764, 0x27b0, 0x2934, 0x2935, - 0x3030, 0x3299, }; + 0x2764, 0x27b0, 0x27bf, 0x2934, + 0x2935, 0x3030, 0x3299, }; static const unsigned short mb_tbl_uni_docomo2code2_value[] = { // 0x203c - 0x3299 0x2988, 0x2987, 0x29b6, 0x29c0, @@ -444,8 +444,8 @@ 0x2927, 0x28ef, 0x28f9, 0x28e6, 0x2957, 0x2917, 0x2919, 0x2918, 0x299d, 0x2932, 0x297e, 0x2986, - 0x2970, 0x298e, 0x2979, 0x2984, - 0x298d, 0x29b8, }; + 0x2970, 0x298e, 0x2963, 0x2979, + 0x2984, 0x298d, 0x29b8, }; static const int mb_tbl_uni_docomo2code2_len = sizeof(mb_tbl_uni_docomo2code2_key)/sizeof(unsigned short); @@ -929,9 +929,9 @@ 0x270a, 0x270b, 0x270c, 0x2728, 0x2733, 0x2734, 0x274c, 0x2753, 0x2754, 0x2755, 0x2757, 0x2764, - 0x27a1, 0x2b05, 0x2b06, 0x2b07, - 0x2b50, 0x2b55, 0x303d, 0x3297, - 0x3299, }; + 0x27a1, 0x27bf, 0x2b05, 0x2b06, + 0x2b07, 0x2b50, 0x2b55, 0x303d, + 0x3297, 0x3299, }; static const unsigned short mb_tbl_uni_sb2code2_value[] = { // 0x2122 - 0x3299 0x2b2e, 0x283e, 0x283d, 0x283f, @@ -949,9 +949,9 @@ 0x2930, 0x2932, 0x2931, 0x29ad, 0x280d, 0x280c, 0x29b2, 0x2940, 0x29b5, 0x29b6, 0x2941, 0x2942, - 0x283b, 0x283c, 0x2839, 0x283a, - 0x29ae, 0x29b1, 0x27d4, 0x298c, - 0x2994, }; + 0x283b, 0x2818, 0x283c, 0x2839, + 0x283a, 0x29ae, 0x29b1, 0x27d4, + 0x298c, 0x2994, }; static const int mb_tbl_uni_sb2code2_len = sizeof(mb_tbl_uni_sb2code2_key)/sizeof(unsigned short); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ emoji2uni.h
hirokawa Sat, 15 Oct 2011 07:14:45 + Revision: http://svn.php.net/viewvc?view=revision&revision=318129 Log: added a missing emoji U+27BF. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/emoji2uni.h Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/emoji2uni.h === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/emoji2uni.h 2011-10-15 07:12:02 UTC (rev 318128) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/emoji2uni.h 2011-10-15 07:14:45 UTC (rev 318129) @@ -42,7 +42,7 @@ 0xEE11, 0x2709, 0xEE12, 0xEE13, 0xf4b4, 0xf193, 0xf194, 0xf511, 0x21a9, 0xf191, 0xf50d, 0xf195, - 0xf6a9, 0x, 0x0023, 0xE82D, + 0xf6a9, 0x27bf, 0x0023, 0xE82D, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x0030, 0x2764, 0xf493, @@ -275,7 +275,7 @@ 0xf6a2, 0xf201, 0xf49f, 0x2734, 0x2733, 0xf51e, 0xf6ad, 0xf530, 0x267f, 0xf4f6, 0x2665, 0x2666, - 0x2660, 0x2663, 0x0023, 0x, + 0x2660, 0x2663, 0x0023, 0x27bf, 0xf195, 0xf199, 0xf192, 0xf236, 0xf21a, 0xf237, 0xf238, 0xf534, 0xf532, 0xf533, 0x0031, 0x0032, @@ -426,8 +426,8 @@ 0x26f5, 0x26fd, 0x2702, 0x2708, 0x2709, 0x270a, 0x270b, 0x270c, 0x270f, 0x2712, 0x2728, 0x2757, - 0x2764, 0x27b0, 0x2934, 0x2935, - 0x3030, 0x3299, }; + 0x2764, 0x27b0, 0x27bf, 0x2934, + 0x2935, 0x3030, 0x3299, }; static const unsigned short mb_tbl_uni_docomo2code2_value[] = { // 0x203c - 0x3299 0x2988, 0x2987, 0x29b6, 0x29c0, @@ -444,8 +444,8 @@ 0x2927, 0x28ef, 0x28f9, 0x28e6, 0x2957, 0x2917, 0x2919, 0x2918, 0x299d, 0x2932, 0x297e, 0x2986, - 0x2970, 0x298e, 0x2979, 0x2984, - 0x298d, 0x29b8, }; + 0x2970, 0x298e, 0x2963, 0x2979, + 0x2984, 0x298d, 0x29b8, }; static const int mb_tbl_uni_docomo2code2_len = sizeof(mb_tbl_uni_docomo2code2_key)/sizeof(unsigned short); @@ -929,9 +929,9 @@ 0x270a, 0x270b, 0x270c, 0x2728, 0x2733, 0x2734, 0x274c, 0x2753, 0x2754, 0x2755, 0x2757, 0x2764, - 0x27a1, 0x2b05, 0x2b06, 0x2b07, - 0x2b50, 0x2b55, 0x303d, 0x3297, - 0x3299, }; + 0x27a1, 0x27bf, 0x2b05, 0x2b06, + 0x2b07, 0x2b50, 0x2b55, 0x303d, + 0x3297, 0x3299, }; static const unsigned short mb_tbl_uni_sb2code2_value[] = { // 0x2122 - 0x3299 0x2b2e, 0x283e, 0x283d, 0x283f, @@ -949,9 +949,9 @@ 0x2930, 0x2932, 0x2931, 0x29ad, 0x280d, 0x280c, 0x29b2, 0x2940, 0x29b5, 0x29b6, 0x2941, 0x2942, - 0x283b, 0x283c, 0x2839, 0x283a, - 0x29ae, 0x29b1, 0x27d4, 0x298c, - 0x2994, }; + 0x283b, 0x2818, 0x283c, 0x2839, + 0x283a, 0x29ae, 0x29b1, 0x27d4, + 0x298c, 0x2994, }; static const int mb_tbl_uni_sb2code2_len = sizeof(mb_tbl_uni_sb2code2_key)/sizeof(unsigned short); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ oniguruma/COPYING oniguruma/HISTORY oniguruma/README oniguruma/README.ja oniguruma/doc/API oniguruma/doc/API.ja oniguruma/doc/FAQ oniguruma/doc/FAQ.ja o
hirokawa Sat, 15 Oct 2011 08:55:53 + Revision: http://svn.php.net/viewvc?view=revision&revision=318132 Log: updated bundled oniguruma regex library to 5.9.2. fixed bug #42290. Bug: https://bugs.php.net/42290 (Assigned) mb_eregi_replace() is not case-insensitive with multibyte pattern Changed paths: U php/php-src/trunk/ext/mbstring/oniguruma/COPYING U php/php-src/trunk/ext/mbstring/oniguruma/HISTORY U php/php-src/trunk/ext/mbstring/oniguruma/README U php/php-src/trunk/ext/mbstring/oniguruma/README.ja U php/php-src/trunk/ext/mbstring/oniguruma/doc/API U php/php-src/trunk/ext/mbstring/oniguruma/doc/API.ja U php/php-src/trunk/ext/mbstring/oniguruma/doc/FAQ U php/php-src/trunk/ext/mbstring/oniguruma/doc/FAQ.ja U php/php-src/trunk/ext/mbstring/oniguruma/doc/RE U php/php-src/trunk/ext/mbstring/oniguruma/doc/RE.ja U php/php-src/trunk/ext/mbstring/oniguruma/enc/ascii.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/big5.c A php/php-src/trunk/ext/mbstring/oniguruma/enc/cp1251.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/euc_jp.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/euc_kr.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/euc_tw.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/gb18030.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_1.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_10.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_11.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_13.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_14.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_15.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_16.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_2.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_3.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_4.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_5.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_6.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_7.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_8.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/iso8859_9.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/koi8.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/koi8_r.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/mktable.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/sjis.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/unicode.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/utf16_be.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/utf16_le.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/utf32_be.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/utf32_le.c U php/php-src/trunk/ext/mbstring/oniguruma/enc/utf8.c U php/php-src/trunk/ext/mbstring/oniguruma/index.html A php/php-src/trunk/ext/mbstring/oniguruma/index_ja.html U php/php-src/trunk/ext/mbstring/oniguruma/onigposix.h U php/php-src/trunk/ext/mbstring/oniguruma/oniguruma.h U php/php-src/trunk/ext/mbstring/oniguruma/regcomp.c U php/php-src/trunk/ext/mbstring/oniguruma/regenc.c U php/php-src/trunk/ext/mbstring/oniguruma/regenc.h U php/php-src/trunk/ext/mbstring/oniguruma/regerror.c U php/php-src/trunk/ext/mbstring/oniguruma/regexec.c U php/php-src/trunk/ext/mbstring/oniguruma/regext.c U php/php-src/trunk/ext/mbstring/oniguruma/reggnu.c U php/php-src/trunk/ext/mbstring/oniguruma/regint.h U php/php-src/trunk/ext/mbstring/oniguruma/regparse.c U php/php-src/trunk/ext/mbstring/oniguruma/regparse.h U php/php-src/trunk/ext/mbstring/oniguruma/regposerr.c U php/php-src/trunk/ext/mbstring/oniguruma/regposix.c U php/php-src/trunk/ext/mbstring/oniguruma/regsyntax.c U php/php-src/trunk/ext/mbstring/oniguruma/regversion.c U php/php-src/trunk/ext/mbstring/oniguruma/st.c A php/php-src/trunk/ext/mbstring/oniguruma/testc.c A php/php-src/trunk/ext/mbstring/oniguruma/testu.c A php/php-src/trunk/ext/mbstring/oniguruma/win32/Makefile A php/php-src/trunk/ext/mbstring/oniguruma/win32/testc.c U php/php-src/trunk/ext/mbstring/tests/mb_eregi_replace.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Tue, 18 Oct 2011 14:03:44 + Revision: http://svn.php.net/viewvc?view=revision&revision=318183 Log: fixed byte length of utf-8. Changed paths: U php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-10-18 11:38:47 UTC (rev 318182) +++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-10-18 14:03:44 UTC (rev 318183) @@ -52,7 +52,7 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1 + 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; static const char *mbfl_encoding_utf8_aliases[] = {"utf8", NULL}; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c
hirokawa Tue, 18 Oct 2011 14:04:13 + Revision: http://svn.php.net/viewvc?view=revision&revision=318184 Log: MFH: fixed byte length of utf-8. Changed paths: U php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c Modified: php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c === --- php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-10-18 14:03:44 UTC (rev 318183) +++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c 2011-10-18 14:04:13 UTC (rev 318184) @@ -52,7 +52,7 @@ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1 + 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; static const char *mbfl_encoding_utf8_aliases[] = {"utf8", NULL}; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_charset.c
hirokawa Tue, 18 Oct 2011 14:28:01 + Revision: http://svn.php.net/viewvc?view=revision&revision=318186 Log: fixed maximum byte length of utf8mb4. Changed paths: U php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c 2011-10-18 14:10:44 UTC (rev 318185) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c 2011-10-18 14:28:01 UTC (rev 318186) @@ -495,8 +495,8 @@ { 42, "latin7", "latin7_general_cs", 1, 1, "", NULL, NULL}, { 43, "macce", "macce_bin", 1, 1, "", NULL, NULL}, { 44, "cp1250", "cp1250_croatian_ci", 1, 1, "", NULL, NULL}, - { 45, UTF8_MB4, UTF8_MB4"_general_ci", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, - { 46, UTF8_MB4, UTF8_MB4"_bin", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 45, UTF8_MB4, UTF8_MB4"_general_ci", 1, 4, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 46, UTF8_MB4, UTF8_MB4"_bin", 1, 4, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 47, "latin1", "latin1_bin", 1, 1, "", NULL, NULL}, { 48, "latin1", "latin1_general_ci", 1, 1, "", NULL, NULL}, { 49, "latin1", "latin1_general_cs", 1, 1, "", NULL, NULL}, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mysqlnd/ mysqlnd_charset.c
hirokawa Tue, 18 Oct 2011 14:28:21 + Revision: http://svn.php.net/viewvc?view=revision&revision=318187 Log: fixed maximum byte length of utf8mb4. Changed paths: U php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_charset.c Modified: php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_charset.c === --- php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_charset.c 2011-10-18 14:28:01 UTC (rev 318186) +++ php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_charset.c 2011-10-18 14:28:21 UTC (rev 318187) @@ -495,8 +495,8 @@ { 42, "latin7", "latin7_general_cs", 1, 1, "", NULL, NULL}, { 43, "macce", "macce_bin", 1, 1, "", NULL, NULL}, { 44, "cp1250", "cp1250_croatian_ci", 1, 1, "", NULL, NULL}, - { 45, UTF8_MB4, UTF8_MB4"_general_ci", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, - { 46, UTF8_MB4, UTF8_MB4"_bin", 1, 3, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 45, UTF8_MB4, UTF8_MB4"_general_ci", 1, 4, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, + { 46, UTF8_MB4, UTF8_MB4"_bin", 1, 4, "UTF-8 Unicode", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid}, { 47, "latin1", "latin1_bin", 1, 1, "", NULL, NULL}, { 48, "latin1", "latin1_general_ci", 1, 1, "", NULL, NULL}, { 49, "latin1", "latin1_general_cs", 1, 1, "", NULL, NULL}, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php