com php-src: added missing parentheses: NEWS ext/mbstring/libmb fl/filters/mbfilter_gb18030.c ext/mbstring/test s/bug68846.phpt

From: Date: Mon, 09 Mar 2015 06:39:04 +0000
Subject: com php-src: added missing parentheses: NEWS ext/mbstring/libmb fl/filters/mbfilter_gb18030.c ext/mbstring/test s/bug68846.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85375@lists.php.net to get a copy of this message
Commit: fa72f1ea869e23fd92c50f69a8350e50d57e1c12 Author: Masaki Kagaya <masakielastic@gmail.com> Wed, 18 Feb 2015 23:17:39 +0900 Committer: Stanislav Malyshev <stas@php.net> Sun, 8 Mar 2015 23:39:04 -0700 Parents: a8da0a9620db144550dc1a20e01f460d6ea0c963 Branches: PHP-5..5 PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fa72f1ea869e23fd92c50f69a8350e50d57e1c12 Log: added missing parentheses added test case for bug #68846 replaced tab with space added missing parentheses again See also: http://icu-project.org/docs/papers/gb18030.html#h7 Bugs: https://bugs.php.net/68846 Changed paths: M NEWS M ext/mbstring/libmbfl/filters/mbfilter_gb18030.c A ext/mbstring/tests/bug68846.phpt Diff: diff --git a/NEWS b/NEWS index b0af1ae..1c8785d 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,10 @@ PHP NEWS (Julian) . Fixed bug #68917 (parse_url fails on some partial urls). (Wei Dai) +- Mbstring: + . Fixed bug #68846 (False detection of CJK Unified Ideographs Extension E). + (Masaki Kagaya) + - Mysqli: . Fixed bug#63486 (mysqli_free_result leave the resource variable in a messy state). (Julian) diff --git a/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c b/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c index f6f12be..7767c65 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c @@ -239,7 +239,7 @@ mbfl_filt_conv_gb18030_wchar(int c, mbfl_convert_filter *filter) if (((c1 >= 0x81 && c1 <= 0x84) || (c1 >= 0x90 && c1 <= 0xe3)) && c2 >= 0x30 && c2 <= 0x39 && c3 >= 0x81 && c3 <= 0xfe && c >= 0x30 && c <= 0x39) { if (c1 >= 0x90 && c1 <= 0xe3) { - w = ((c1 - 0x90)*10 + (c2 - 0x30)*126 + (c3 - 0x81))*10 + (c - 0x30) + 0x10000; + w = ((((c1 - 0x90)*10 + (c2 - 0x30))*126 + (c3 - 0x81)))*10 + (c - 0x30) + 0x10000; } else { /* Unicode BMP */ w = (((c1 - 0x81)*10 + (c2 - 0x30))*126 + (c3 - 0x81))*10 + (c - 0x30); if (w >= 0 && w <= 39419) { diff --git a/ext/mbstring/tests/bug68846.phpt b/ext/mbstring/tests/bug68846.phpt new file mode 100644 index 0000000..1b43e3d --- /dev/null +++ b/ext/mbstring/tests/bug68846.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #68846 False detection of CJK Unified Ideographs Extension E +--SKIPIF-- +<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?> +--FILE-- +<?php +var_dump( + "\x00\x02\x0b\xb7" === mb_convert_encoding("\x95\x34\xb2\x35", 'UTF-32', 'GB18030') +); +?> +--EXPECT-- +bool(true) \ No newline at end of file

« previous php.cvs (#85375) next »