[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

2013-07-30 Thread Rui Hirokawa
Commit:c10d7e1afc63f0a0eaadb115560cc3ca626eb245
Author:Rui Hirokawa hirok...@php.net 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-cache6) | (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;
-   filter-status++;
-   } else {
-   w = s  MBFL_WCSGROUP_MASK;
-   flag = 1;
-   }
-   break;
-   case 0x31: /* 4byte code 3rd char: 0x80-0xbf */
-   filter-cache |= ((c  0x3f

[PHP-CVS] com php-src: added test script for bug65045.: ext/mbstring/tests/bug65045.phpt

2013-07-30 Thread Rui Hirokawa
Commit:7da331501545c36088b535be0c53580a268ee5f4
Author:Rui Hirokawa hirok...@php.net 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--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+
+//declare(encoding = 'UTF-8');
+mb_internal_encoding('UTF-8');
+
+$str = \xF0\xA4\xAD.  \xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2;
+$expected = \xEF\xBF\xBD.\xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2;
+
+$str2 = \xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2.\xF0\xA4\xAD;
+$expected2 = \xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2.\xEF\xBF\xBD;
+
+mb_substitute_character(0xFFFD);
+var_dump(
+$expected === htmlspecialchars_decode(htmlspecialchars($str, 
ENT_SUBSTITUTE, 'UTF-8')),
+$expected2 === htmlspecialchars_decode(htmlspecialchars($str2, 
ENT_SUBSTITUTE, 'UTF-8')), 
+$expected === mb_convert_encoding($str, 'UTF-8', 'UTF-8'),
+$expected2 === mb_convert_encoding($str2, 'UTF-8', 'UTF-8')
+);
+
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
\ No newline at end of file


--
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

2013-07-30 Thread Rui Hirokawa
Commit:0a974f14d13832838dcc7bae88b3271b7d035f46
Author:Rui Hirokawa hirok...@php.net 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-cache6) | (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;
-   filter-status++;
-   } else {
-   w = s  MBFL_WCSGROUP_MASK;
-   flag = 1;
-   }
-   break;
-   case 0x31: /* 4byte code 3rd char: 0x80-0xbf

[PHP-CVS] com php-src: updated test script for bug #65045.: ext/mbstring/tests/illformed_utf_sequences.phpt

2013-07-20 Thread Rui Hirokawa
Commit:cb607d4f7862f2c9735e48524c4ae2e499698e8c
Author:Rui Hirokawa hirok...@php.net 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

2013-07-20 Thread Rui Hirokawa

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 hirok...@php.net wrote:

Commit:c6a7549efcca62346687b0fda5b408b963f5ab2d
Author:Rui Hirokawa hirok...@php.net 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: 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

2013-06-30 Thread Rui Hirokawa
Commit:c6a7549efcca62346687b0fda5b408b963f5ab2d
Author:Rui Hirokawa hirok...@php.net 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-cache6) | (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;
-   filter-status++;
-   } else {
-   w = s  MBFL_WCSGROUP_MASK;
-   flag = 1;
-   }
-   break;
-   case 0x31: /* 4byte code 3rd char: 0x80-0xbf */
-   filter-cache |= ((c  0x3f)  6);
-   filter-status

[PHP-CVS] com php-src: added test code for #65045.: ext/mbstring/tests/bug65045.phpt

2013-06-30 Thread Rui Hirokawa
Commit:1db66942e1c2e16b36ee614d827605b9fd9b611f
Author:Rui Hirokawa hirok...@php.net 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--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+
+//declare(encoding = 'UTF-8');
+mb_internal_encoding('UTF-8');
+
+$str = \xF0\xA4\xAD.  \xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2;
+$expected = \xEF\xBF\xBD.\xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2;
+
+$str2 = \xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2.\xF0\xA4\xAD;
+$expected2 = \xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2.\xEF\xBF\xBD;
+
+mb_substitute_character(0xFFFD);
+var_dump(
+$expected === htmlspecialchars_decode(htmlspecialchars($str, 
ENT_SUBSTITUTE, 'UTF-8')),
+$expected2 === htmlspecialchars_decode(htmlspecialchars($str2, 
ENT_SUBSTITUTE, 'UTF-8')), 
+$expected === mb_convert_encoding($str, 'UTF-8', 'UTF-8'),
+$expected2 === mb_convert_encoding($str2, 'UTF-8', 'UTF-8')
+);
+
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
\ No newline at end of file


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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

2012-04-09 Thread Rui Hirokawa
Commit:b28231165a8eef2fcbdbc41d6abc4d0d46155172
Author:Rui Hirokawa rui.hirok...@gmail.com 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

2012-04-09 Thread Rui Hirokawa
Commit:882dca647a42c974102cfd1c75818764a18f
Author:Rui Hirokawa rui.hirok...@gmail.com 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] 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

2012-03-02 Thread Rui Hirokawa
hirokawa Fri, 02 Mar 2012 14:19:05 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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  regs-num_regs) {
+		if (regs-beg[n] = 0  regs-beg[n]  regs-end[n]  

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ Zend/tests/multibyte/multibyte_encoding_003.phpt ext/mbstring/tests/mb_ereg_search_pos.phpt ext/mbstring/tests/zend_multibyte-10.phpt ext/mbstring/tests/z

2012-01-14 Thread Rui Hirokawa
hirokawa Sat, 14 Jan 2012 09:07:10 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=322265

Log:
fixed failed tests (backport from PHP_5_4/trunk).

Changed paths:
U   
php/php-src/branches/PHP_5_3/Zend/tests/multibyte/multibyte_encoding_003.phpt
U   php/php-src/branches/PHP_5_3/ext/mbstring/tests/mb_ereg_search_pos.phpt
U   php/php-src/branches/PHP_5_3/ext/mbstring/tests/zend_multibyte-10.phpt
U   php/php-src/branches/PHP_5_3/ext/mbstring/tests/zend_multibyte-11.phpt

Modified: 
php/php-src/branches/PHP_5_3/Zend/tests/multibyte/multibyte_encoding_003.phpt
===
--- 
php/php-src/branches/PHP_5_3/Zend/tests/multibyte/multibyte_encoding_003.phpt   
2012-01-14 07:46:02 UTC (rev 322264)
+++ 
php/php-src/branches/PHP_5_3/Zend/tests/multibyte/multibyte_encoding_003.phpt   
2012-01-14 09:07:10 UTC (rev 322265)
@@ -18,5 +18,5 @@
 
 
 --EXPECT--
-H
-
\ No newline at end of file
+Hello World
+===DONE===

Modified: 
php/php-src/branches/PHP_5_3/ext/mbstring/tests/mb_ereg_search_pos.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/tests/mb_ereg_search_pos.phpt 
2012-01-14 07:46:02 UTC (rev 322264)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/tests/mb_ereg_search_pos.phpt 
2012-01-14 09:07:10 UTC (rev 322265)
@@ -6,7 +6,7 @@
 ?
 --FILE--
 ?php
-
+mb_regex_encoding('iso-8859-1');
 $test_str = 'I�t�rn�ti�n�liz�ti�n';

 if(mb_ereg_search_init($test_str))

Modified: php/php-src/branches/PHP_5_3/ext/mbstring/tests/zend_multibyte-10.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/tests/zend_multibyte-10.phpt  
2012-01-14 07:46:02 UTC (rev 322264)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/tests/zend_multibyte-10.phpt  
2012-01-14 09:07:10 UTC (rev 322265)
@@ -11,6 +11,8 @@
 ?php
 declare(encoding=ISO-8859-15);
 declare(encoding=ISO-8859-1);
+echo ok\n;
 ?
 --EXPECTF--
-Fatal error: Encoding declaration pragma must be the very first statement in 
the script in %s on line 3
+ok
+

Modified: php/php-src/branches/PHP_5_3/ext/mbstring/tests/zend_multibyte-11.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mbstring/tests/zend_multibyte-11.phpt  
2012-01-14 07:46:02 UTC (rev 322264)
+++ php/php-src/branches/PHP_5_3/ext/mbstring/tests/zend_multibyte-11.phpt  
2012-01-14 09:07:10 UTC (rev 322265)
@@ -11,7 +11,8 @@
 ?php
 declare(encoding=ISO-8859-15) {
declare(encoding=ISO-8859-1);
+   echo ok\n;
 }
 ?
 --EXPECTF--
-Fatal error: Encoding declaration pragma must be the very first statement in 
the script in %s on line 3
+ok

-- 
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_3/ NEWS ext/standard/tests/general_functions/bug60227.phpt main/SAPI.c

2012-01-13 Thread Rui Hirokawa
hirokawa Sat, 14 Jan 2012 07:41:01 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=322263

Log:
MFH: fixed bug #60227: header() cannot detect the multi-line header with CR.

Bug: https://bugs.php.net/60227 (Closed) header() cannot detect the multi-line 
header with CR(0x0D).
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A   
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug60227.phpt
U   php/php-src/branches/PHP_5_3/main/SAPI.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-01-14 06:47:23 UTC (rev 322262)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-01-14 07:41:01 UTC (rev 322263)
@@ -1,5 +1,10 @@
 PHPNEWS
 |||
+?? ?? 2012, PHP 5.3.10
+
+- Core:
+ . fixed bug #60227: header() cannot detect the multi-line header with CR 
(rui).
+
 10 Jan 2012, PHP 5.3.9

 - Core:

Added: 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug60227.phpt
===
--- 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug60227.phpt 
(rev 0)
+++ 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug60227.phpt 
2012-01-14 07:41:01 UTC (rev 322263)
@@ -0,0 +1,20 @@
+--TEST--
+Bug #60227 (header() cannot detect the multi-line header with CR)
+--FILE--
+?php
+header(X-Foo1: a);
+header(X-Foo2: b\n );
+header(X-Foo3: c\r\n );
+header(X-Foo4: d\r );
+header(X-Foo5: e\rSet-Cookie: ID=123);
+echo 'foo';
+?
+--EXPECTF--
+Warning: Header may not contain more than a single header, new line detected. 
in %s on line %d
+foo
+--EXPECTHEADERS--
+X-Foo1: a
+X-Foo2: b
+X-Foo3: c
+X-Foo4: d
+


Property changes on: 
php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/bug60227.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_3/main/SAPI.c
===
--- php/php-src/branches/PHP_5_3/main/SAPI.c2012-01-14 06:47:23 UTC (rev 
322262)
+++ php/php-src/branches/PHP_5_3/main/SAPI.c2012-01-14 07:41:01 UTC (rev 
322263)
@@ -592,7 +592,7 @@
} else {
/* new line safety check */
char *s = header_line, *e = header_line + header_line_len, *p;
-   while (s  e  (p = memchr(s, '\n', (e - s {
+   while (s  e  ((p = memchr(s, '\n', (e - s))) || (p = 
memchr(s, '\r', (e - s) {
if (*(p + 1) == ' ' || *(p + 1) == '\t') {
s = p + 1;
continue;

-- 
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 ext/standard/basic_functions.c ext/standard/exec.c ext/standard/exec.h ext/standard/tests/general_functions/bug60116.phpt

2011-11-11 Thread Rui Hirokawa
hirokawa Fri, 11 Nov 2011 14:52:56 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319057

Log:
revert changes to fix bug #60116.

Bug: https://bugs.php.net/60116 (Assigned) escapeshellcmd() cannot escape the 
chars which causes shell injection.
  
Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c
U   php/php-src/branches/PHP_5_4/ext/standard/exec.c
U   php/php-src/branches/PHP_5_4/ext/standard/exec.h
D   
php/php-src/branches/PHP_5_4/ext/standard/tests/general_functions/bug60116.phpt

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2011-11-11 14:44:06 UTC (rev 319056)
+++ php/php-src/branches/PHP_5_4/NEWS   2011-11-11 14:52:56 UTC (rev 319057)
@@ -3,8 +3,6 @@
 ?? ??? 2011, PHP 5.4.0 RC2

 - Core:
-  . Fixed bug #60116 (escapeshellcmd() cannot escape the characters
- which cause shell command injection). (rui)
   . Fixed bug #60227 (header() cannot detect the multi-line header with
  CR(0x0D)). (rui)


Modified: php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c
===
--- php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c 2011-11-11 
14:44:06 UTC (rev 319056)
+++ php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c 2011-11-11 
14:52:56 UTC (rev 319057)
@@ -3583,7 +3583,6 @@
 #endif

register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU);
-   register_exec_constants(INIT_FUNC_ARGS_PASSTHRU);
register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
register_string_constants(INIT_FUNC_ARGS_PASSTHRU);


Modified: php/php-src/branches/PHP_5_4/ext/standard/exec.c
===
--- php/php-src/branches/PHP_5_4/ext/standard/exec.c2011-11-11 14:44:06 UTC 
(rev 319056)
+++ php/php-src/branches/PHP_5_4/ext/standard/exec.c2011-11-11 14:52:56 UTC 
(rev 319057)
@@ -50,16 +50,6 @@
 #include unistd.h
 #endif

-/* {{{ register_exec_constants
- *  */
-void register_exec_constants(INIT_FUNC_ARGS)
-{
-REGISTER_LONG_CONSTANT(ESCAPE_CMD_PAIR, ESCAPE_CMD_PAIR, 
CONST_PERSISTENT|CONST_CS);
-REGISTER_LONG_CONSTANT(ESCAPE_CMD_END, ESCAPE_CMD_END, 
CONST_PERSISTENT|CONST_CS);
-REGISTER_LONG_CONSTANT(ESCAPE_CMD_ALL, ESCAPE_CMD_ALL, 
CONST_PERSISTENT|CONST_CS);
-}
-/* }}} */
-
 /* {{{ php_exec
  * If type==0, only last line of output is returned (exec)
  * If type==1, all lines will be printed and last lined returned (system)
@@ -248,7 +238,7 @@

*NOT* safe for binary strings
 */
-PHPAPI char *php_escape_shell_cmd_ex(char *str, int flag)
+PHPAPI char *php_escape_shell_cmd(char *str)
 {
register int x, y, l = strlen(str);
char *cmd;
@@ -276,25 +266,13 @@
 #ifndef PHP_WIN32
case '':
case '\'':
-   if (flag == ESCAPE_CMD_ALL) {
+   if (!p  (p = memchr(str + x + 1, str[x], l - 
x - 1))) {
+   /* noop */
+   } else if (p  *p == str[x]) {
+   p = NULL;
+   } else {
cmd[y++] = '\\';
cmd[y++] = str[x];
-   } else if (flag == ESCAPE_CMD_END) {
-   if ((x == 0 || x == l - 1)  (str[0] 
== str[l-1])) {
-   cmd[y++] = str[x];
-} else {
-cmd[y++] = '\\';
-cmd[y++] = str[x];
-}
-   } else { /* ESCAPE_CMD_PAIR */
-   if (!p  (p = memchr(str + x + 1, 
str[x], l - x - 1))) {
-   /* noop */
-   } else if (p  *p == str[x]) {
-   p = NULL;
-   } else {
-   cmd[y++] = '\\';
-   }
-   cmd[y++] = str[x];
}
break;
 #else
@@ -349,14 +327,6 @@
 }
 /* }}} */

-/* {{{ php_escape_shell_cmd
- */
-PHPAPI char *php_escape_shell_cmd(char *str)
-{
-return php_escape_shell_cmd_ex(str, ESCAPE_CMD_PAIR);
-}
-/* }}} */
-
 /* {{{ php_escape_shell_arg
  */
 PHPAPI char *php_escape_shell_arg(char *str)
@@ -427,15 +397,14 @@
 {
char *command;
int command_len;
-   long flag = ESCAPE_CMD_PAIR;
char *cmd = NULL;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|l, command, 
command_len, flag) == 

[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ basic_functions.c exec.c exec.h tests/general_functions/bug60116.phpt

2011-11-11 Thread Rui Hirokawa
hirokawa Fri, 11 Nov 2011 14:58:32 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319058

Log:
revert changes to fix bug #60116.

Bug: https://bugs.php.net/60116 (error getting bug information)
  
Changed paths:
U   php/php-src/trunk/ext/standard/basic_functions.c
U   php/php-src/trunk/ext/standard/exec.c
U   php/php-src/trunk/ext/standard/exec.h
D   php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt

Modified: php/php-src/trunk/ext/standard/basic_functions.c
===
--- php/php-src/trunk/ext/standard/basic_functions.c2011-11-11 14:52:56 UTC 
(rev 319057)
+++ php/php-src/trunk/ext/standard/basic_functions.c2011-11-11 14:58:32 UTC 
(rev 319058)
@@ -3615,7 +3615,6 @@
 #endif

register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU);
-   register_exec_constants(INIT_FUNC_ARGS_PASSTHRU);
register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
register_string_constants(INIT_FUNC_ARGS_PASSTHRU);


Modified: php/php-src/trunk/ext/standard/exec.c
===
--- php/php-src/trunk/ext/standard/exec.c   2011-11-11 14:52:56 UTC (rev 
319057)
+++ php/php-src/trunk/ext/standard/exec.c   2011-11-11 14:58:32 UTC (rev 
319058)
@@ -50,16 +50,6 @@
 #include unistd.h
 #endif

-/* {{{ register_exec_constants
- *  */
-void register_exec_constants(INIT_FUNC_ARGS)
-{
-REGISTER_LONG_CONSTANT(ESCAPE_CMD_PAIR, ESCAPE_CMD_PAIR, 
CONST_PERSISTENT|CONST_CS);
-REGISTER_LONG_CONSTANT(ESCAPE_CMD_END, ESCAPE_CMD_END, 
CONST_PERSISTENT|CONST_CS);
-REGISTER_LONG_CONSTANT(ESCAPE_CMD_ALL, ESCAPE_CMD_ALL, 
CONST_PERSISTENT|CONST_CS);
-}
-/* }}} */
-
 /* {{{ php_exec
  * If type==0, only last line of output is returned (exec)
  * If type==1, all lines will be printed and last lined returned (system)
@@ -248,7 +238,7 @@

*NOT* safe for binary strings
 */
-PHPAPI char *php_escape_shell_cmd_ex(char *str, int flag)
+PHPAPI char *php_escape_shell_cmd(char *str)
 {
register int x, y, l = strlen(str);
char *cmd;
@@ -276,25 +266,13 @@
 #ifndef PHP_WIN32
case '':
case '\'':
-   if (flag == ESCAPE_CMD_ALL) {
+   if (!p  (p = memchr(str + x + 1, str[x], l - 
x - 1))) {
+   /* noop */
+   } else if (p  *p == str[x]) {
+   p = NULL;
+   } else {
cmd[y++] = '\\';
cmd[y++] = str[x];
-   } else if (flag == ESCAPE_CMD_END) {
-   if ((x == 0 || x == l - 1)  (str[0] 
== str[l-1])) {
-   cmd[y++] = str[x];
-} else {
-cmd[y++] = '\\';
-cmd[y++] = str[x];
-}
-   } else { /* ESCAPE_CMD_PAIR */
-   if (!p  (p = memchr(str + x + 1, 
str[x], l - x - 1))) {
-   /* noop */
-   } else if (p  *p == str[x]) {
-   p = NULL;
-   } else {
-   cmd[y++] = '\\';
-   }
-   cmd[y++] = str[x];
}
break;
 #else
@@ -349,14 +327,6 @@
 }
 /* }}} */

-/* {{{ php_escape_shell_cmd
- */
-PHPAPI char *php_escape_shell_cmd(char *str)
-{
-return php_escape_shell_cmd_ex(str, ESCAPE_CMD_PAIR);
-}
-/* }}} */
-
 /* {{{ php_escape_shell_arg
  */
 PHPAPI char *php_escape_shell_arg(char *str)
@@ -427,15 +397,14 @@
 {
char *command;
int command_len;
-   long flag = ESCAPE_CMD_PAIR;
char *cmd = NULL;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|l, command, 
command_len, flag) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, command, 
command_len) == FAILURE) {
return;
}

if (command_len) {
-   cmd = php_escape_shell_cmd_ex(command, flag);
+   cmd = php_escape_shell_cmd(command);
RETVAL_STRING(cmd, 0);
} else {
RETVAL_EMPTY_STRING();

Modified: php/php-src/trunk/ext/standard/exec.h
===
--- php/php-src/trunk/ext/standard/exec.h   2011-11-11 14:52:56 UTC (rev 
319057)
+++ php/php-src/trunk/ext/standard/exec.h   2011-11-11 14:58:32 UTC (rev 
319058)
@@ -21,10 +21,6 @@
 #ifndef EXEC_H
 #define EXEC_H


[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS ext/standard/exec.c ext/standard/tests/general_functions/bug60116.phpt

2011-11-10 Thread Rui Hirokawa
hirokawa Thu, 10 Nov 2011 14:19:06 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318996

Log:
MFH: fixed bug #60116 (escapeshellcmd() cannot escape the characters which 
cause shell command injection).

Bug: https://bugs.php.net/60116 (error getting bug information)
  
Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/standard/exec.c
A   
php/php-src/branches/PHP_5_4/ext/standard/tests/general_functions/bug60116.phpt

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2011-11-10 14:12:48 UTC (rev 318995)
+++ php/php-src/branches/PHP_5_4/NEWS   2011-11-10 14:19:06 UTC (rev 318996)
@@ -24,8 +24,10 @@
   . Fixed bug #60169 (Conjunction of ternary and list crashes PHP).
 (Laruence)
   . Fixed bug #55475 (is_a() triggers autoloader, new optional 3rd argument to
-is_a and is_subclass_of). (alan_k)
-
+is_a and is_subclass_of). (alan_k)
+  . Fixed bug #60116 (escapeshellcmd() cannot escape the characters
+ which cause shell command injection). (rui)
+
 - Oracle Database extension (OCI8):
   . Increased maxium Oracle error message buffer length for new 11.2.0.3 size
 (Chris Jones)

Modified: php/php-src/branches/PHP_5_4/ext/standard/exec.c
===
--- php/php-src/branches/PHP_5_4/ext/standard/exec.c2011-11-10 14:12:48 UTC 
(rev 318995)
+++ php/php-src/branches/PHP_5_4/ext/standard/exec.c2011-11-10 14:19:06 UTC 
(rev 318996)
@@ -50,6 +50,16 @@
 #include unistd.h
 #endif

+/* {{{ register_exec_constants
+ *  */
+void register_exec_constants(INIT_FUNC_ARGS)
+{
+REGISTER_LONG_CONSTANT(ESCAPE_CMD_PAIR, ESCAPE_CMD_PAIR, 
CONST_PERSISTENT|CONST_CS);
+REGISTER_LONG_CONSTANT(ESCAPE_CMD_END, ESCAPE_CMD_END, 
CONST_PERSISTENT|CONST_CS);
+REGISTER_LONG_CONSTANT(ESCAPE_CMD_ALL, ESCAPE_CMD_ALL, 
CONST_PERSISTENT|CONST_CS);
+}
+/* }}} */
+
 /* {{{ php_exec
  * If type==0, only last line of output is returned (exec)
  * If type==1, all lines will be printed and last lined returned (system)
@@ -238,7 +248,7 @@

*NOT* safe for binary strings
 */
-PHPAPI char *php_escape_shell_cmd(char *str)
+PHPAPI char *php_escape_shell_cmd_ex(char *str, int flag)
 {
register int x, y, l = strlen(str);
char *cmd;
@@ -266,14 +276,26 @@
 #ifndef PHP_WIN32
case '':
case '\'':
-   if (!p  (p = memchr(str + x + 1, str[x], l - 
x - 1))) {
-   /* noop */
-   } else if (p  *p == str[x]) {
-   p = NULL;
-   } else {
+   if (flag == ESCAPE_CMD_ALL) {
cmd[y++] = '\\';
+   cmd[y++] = str[x];
+   } else if (flag == ESCAPE_CMD_END) {
+   if ((x == 0 || x == l - 1)  (str[0] 
== str[l-1])) {
+   cmd[y++] = str[x];
+} else {
+cmd[y++] = '\\';
+cmd[y++] = str[x];
+}
+   } else { /* ESCAPE_CMD_PAIR */
+   if (!p  (p = memchr(str + x + 1, 
str[x], l - x - 1))) {
+   /* noop */
+   } else if (p  *p == str[x]) {
+   p = NULL;
+   } else {
+   cmd[y++] = '\\';
+   }
+   cmd[y++] = str[x];
}
-   cmd[y++] = str[x];
break;
 #else
/* % is Windows specific for enviromental variables, 
^%PATH% will
@@ -327,6 +349,14 @@
 }
 /* }}} */

+/* {{{ php_escape_shell_cmd
+ */
+PHPAPI char *php_escape_shell_cmd(char *str)
+{
+return php_escape_shell_cmd_ex(str, ESCAPE_CMD_PAIR);
+}
+/* }}} */
+
 /* {{{ php_escape_shell_arg
  */
 PHPAPI char *php_escape_shell_arg(char *str)
@@ -397,14 +427,15 @@
 {
char *command;
int command_len;
+   long flag = ESCAPE_CMD_PAIR;
char *cmd = NULL;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, command, 
command_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|l, command, 
command_len, flag) == FAILURE) {
return;
}

if (command_len) {
-   cmd = php_escape_shell_cmd(command);
+   cmd = php_escape_shell_cmd_ex(command, flag);

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS ext/standard/tests/general_functions/bug60227.phpt main/SAPI.c

2011-11-10 Thread Rui Hirokawa
hirokawa Thu, 10 Nov 2011 14:24:31 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318997

Log:
MFH: fixed bug #60227 (header() cannot detect the multi-line header with 
CR(0x0D).)

Bug: https://bugs.php.net/60227 (error getting bug information)
  
Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
A   
php/php-src/branches/PHP_5_4/ext/standard/tests/general_functions/bug60227.phpt
U   php/php-src/branches/PHP_5_4/main/SAPI.c

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2011-11-10 14:19:06 UTC (rev 318996)
+++ php/php-src/branches/PHP_5_4/NEWS   2011-11-10 14:24:31 UTC (rev 318997)
@@ -27,6 +27,8 @@
 is_a and is_subclass_of). (alan_k)
   . Fixed bug #60116 (escapeshellcmd() cannot escape the characters
  which cause shell command injection). (rui)
+  . Fixed bug #60227 (header() cannot detect the multi-line header with
+ CR(0x0D)). (rui)

 - Oracle Database extension (OCI8):
   . Increased maxium Oracle error message buffer length for new 11.2.0.3 size

Added: 
php/php-src/branches/PHP_5_4/ext/standard/tests/general_functions/bug60227.phpt
===
--- 
php/php-src/branches/PHP_5_4/ext/standard/tests/general_functions/bug60227.phpt 
(rev 0)
+++ 
php/php-src/branches/PHP_5_4/ext/standard/tests/general_functions/bug60227.phpt 
2011-11-10 14:24:31 UTC (rev 318997)
@@ -0,0 +1,20 @@
+--TEST--
+Bug #60227 (header() cannot detect the multi-line header with CR)
+--FILE--
+?php
+header(X-Foo1: a);
+header(X-Foo2: b\n );
+header(X-Foo3: c\r\n );
+header(X-Foo4: d\r );
+header(X-Foo5: e\rSet-Cookie: ID=123);
+echo 'foo';
+?
+--EXPECTF--
+Warning: Header may not contain more than a single header, new line detected. 
in %s on line %d
+foo
+--EXPECTHEADERS--
+X-Foo1: a
+X-Foo2: b
+X-Foo3: c
+X-Foo4: d
+


Property changes on: 
php/php-src/branches/PHP_5_4/ext/standard/tests/general_functions/bug60227.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_4/main/SAPI.c
===
--- php/php-src/branches/PHP_5_4/main/SAPI.c2011-11-10 14:19:06 UTC (rev 
318996)
+++ php/php-src/branches/PHP_5_4/main/SAPI.c2011-11-10 14:24:31 UTC (rev 
318997)
@@ -712,7 +712,7 @@
} else {
/* new line safety check */
char *s = header_line, *e = header_line + header_line_len, *p;
-   while (s  e  (p = memchr(s, '\n', (e - s {
+   while (s  e  ((p = memchr(s, '\n', (e - s))) || (p = 
memchr(s, '\r', (e - s) {
if (*(p + 1) == ' ' || *(p + 1) == '\t') {
s = p + 1;
continue;

-- 
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

2011-11-10 Thread Rui Hirokawa
hirokawa Thu, 10 Nov 2011 21:45:36 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319010

Log:
moved the new changes for RC2.

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-11-10 21:42:04 UTC (rev 319009)
+++ php/php-src/branches/PHP_5_4/NEWS   2011-11-10 21:45:36 UTC (rev 319010)
@@ -2,6 +2,12 @@
 |||
 ?? ??? 2011, PHP 5.4.0 RC2

+- Core:
+  . Fixed bug #60116 (escapeshellcmd() cannot escape the characters
+ which cause shell command injection). (rui)
+  . Fixed bug #60227 (header() cannot detect the multi-line header with
+ CR(0x0D)). (rui)
+
 11 Nov 2011, PHP 5.4.0 RC1
 - General improvements:
   . Changed silent conversion of array to string to produce a notice. (Patrick)
@@ -25,10 +31,6 @@
 (Laruence)
   . Fixed bug #55475 (is_a() triggers autoloader, new optional 3rd argument to
 is_a and is_subclass_of). (alan_k)
-  . Fixed bug #60116 (escapeshellcmd() cannot escape the characters
- which cause shell command injection). (rui)
-  . Fixed bug #60227 (header() cannot detect the multi-line header with
- CR(0x0D)). (rui)

 - Oracle Database extension (OCI8):
   . Increased maxium Oracle error message buffer length for new 11.2.0.3 size

-- 
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/tests/general_functions/bug60227.phpt main/SAPI.c

2011-11-06 Thread Rui Hirokawa
hirokawa Sun, 06 Nov 2011 11:07:14 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318820

Log:
fixed bug #60227: header() cannot detect the multi-line header with CR.

Bug: https://bugs.php.net/60227 (Open) header() cannot detect the multi-line 
header with CR(0x0D).
  
Changed paths:
A   php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
U   php/php-src/trunk/main/SAPI.c

Added: php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
2011-11-06 11:07:14 UTC (rev 318820)
@@ -0,0 +1,20 @@
+--TEST--
+Bug #60227 (header() cannot detect the multi-line header with CR)
+--FILE--
+?php
+header(X-Foo1: a);
+header(X-Foo2: b\n );
+header(X-Foo3: c\r\n );
+header(X-Foo4: d\r );
+header(X-Foo5: e\rSet-Cookie: ID=123);
+echo 'foo';
+?
+--EXPECTF--
+Warning: Header may not contain more than a single header, new line detected. 
in %s on line %d
+foo
+--EXPECTHEADERS--
+X-Foo1: a
+X-Foo2: b
+X-Foo3: c
+X-Foo4: d
+


Property changes on: 
php/php-src/trunk/ext/standard/tests/general_functions/bug60227.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/trunk/main/SAPI.c
===
--- php/php-src/trunk/main/SAPI.c   2011-11-06 07:41:04 UTC (rev 318819)
+++ php/php-src/trunk/main/SAPI.c   2011-11-06 11:07:14 UTC (rev 318820)
@@ -712,7 +712,7 @@
} else {
/* new line safety check */
char *s = header_line, *e = header_line + header_line_len, *p;
-   while (s  e  (p = memchr(s, '\n', (e - s {
+   while (s  e  ((p = memchr(s, '\n', (e - s))) || (p = 
memchr(s, '\r', (e - s) {
if (*(p + 1) == ' ' || *(p + 1) == '\t') {
s = p + 1;
continue;

-- 
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/ html_tables.h

2011-11-04 Thread Rui Hirokawa
hirokawa Sat, 05 Nov 2011 04:43:35 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318802

Log:
added japanese encoding to maintain compatibility with PHP 5.3.

Changed paths:
U   php/php-src/trunk/ext/standard/html_tables.h

Modified: php/php-src/trunk/ext/standard/html_tables.h
===
--- php/php-src/trunk/ext/standard/html_tables.h2011-11-05 04:33:02 UTC 
(rev 318801)
+++ php/php-src/trunk/ext/standard/html_tables.h2011-11-05 04:43:35 UTC 
(rev 318802)
@@ -57,8 +57,11 @@
{ Shift_JIS,  cs_sjis },
{ SJIS,   cs_sjis },
{ 932,cs_sjis },
+   { SJIS-win,   cs_sjis },
+   { CP932,  cs_sjis },
{ EUCJP,  cs_eucjp },
{ EUC-JP, cs_eucjp },
+   { eucJP-win,  cs_eucjp },
{ KOI8-R, cs_koi8r },
{ koi8-ru,cs_koi8r },
{ koi8r,  cs_koi8r },

-- 
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/standard/ html_tables.h

2011-11-04 Thread Rui Hirokawa
hirokawa Sat, 05 Nov 2011 04:44:16 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318803

Log:
MFH: added japanese encoding to maintain compatibility with PHP 5.3.

Changed paths:
U   php/php-src/branches/PHP_5_4/ext/standard/html_tables.h

Modified: php/php-src/branches/PHP_5_4/ext/standard/html_tables.h
===
--- php/php-src/branches/PHP_5_4/ext/standard/html_tables.h 2011-11-05 
04:43:35 UTC (rev 318802)
+++ php/php-src/branches/PHP_5_4/ext/standard/html_tables.h 2011-11-05 
04:44:16 UTC (rev 318803)
@@ -57,8 +57,11 @@
{ Shift_JIS,  cs_sjis },
{ SJIS,   cs_sjis },
{ 932,cs_sjis },
+   { SJIS-win,   cs_sjis },
+   { CP932,  cs_sjis },
{ EUCJP,  cs_eucjp },
{ EUC-JP, cs_eucjp },
+   { eucJP-win,  cs_eucjp },
{ KOI8-R, cs_koi8r },
{ koi8-ru,cs_koi8r },
{ koi8r,  cs_koi8r },

-- 
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 mbfilter_utf8_mobile.c

2011-11-02 Thread Rui Hirokawa
hirokawa Wed, 02 Nov 2011 14:51:39 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318690

Log:
fixed alias and encoding mapping for emoji logo.

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
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.c
===
--- php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c   
2011-11-02 14:49:41 UTC (rev 318689)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c   
2011-11-02 14:51:39 UTC (rev 318690)
@@ -52,7 +52,7 @@
mbfl_no_encoding_sjis_docomo,
SJIS-Mobile#DOCOMO,
Shift_JIS,
-   mbfl_encoding_sjis_docomo_aliases,
+   (const char *(*)[])mbfl_encoding_sjis_docomo_aliases,
mblen_table_sjis,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
 };
@@ -61,7 +61,7 @@
mbfl_no_encoding_sjis_kddi,
SJIS-Mobile#KDDI,
Shift_JIS,
-   mbfl_encoding_sjis_kddi_aliases,
+   (const char *(*)[])mbfl_encoding_sjis_kddi_aliases,
mblen_table_sjis,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
 };
@@ -70,7 +70,7 @@
mbfl_no_encoding_sjis_sb,
SJIS-Mobile#SOFTBANK,
Shift_JIS,
-   mbfl_encoding_sjis_sb_aliases,
+   (const char *(*)[])mbfl_encoding_sjis_sb_aliases,
mblen_table_sjis,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
 };
@@ -155,35 +155,36 @@
 static const int nflags_code_sb[10] = {0x2b0a, 0x2b05, 0x2b08, 0x2b04, 0x2b07, 
0x2b06, 0x2b02, 0x2b0b, 0x2b09, 0x2b03};

 const unsigned short mbfl_docomo2uni_pua[4][3] = {
-   {0x28c2, 0x2929, 0xe63e},
-   {0x2930, 0x2932, 0xe6ac},
-   {0x2935, 0x293e, 0xe6b1},
+   {0x28c2, 0x292f, 0xe63e},
+   {0x2930, 0x2934, 0xe6ac},
+   {0x2935, 0x2951, 0xe6b1},
{0x2952, 0x29db, 0xe6ce},
 };

-const unsigned short mbfl_kddi2uni_pua[6][3] = {
+const unsigned short mbfl_kddi2uni_pua[7][3] = {
{0x26ec, 0x2838, 0xe468},
{0x284c, 0x2863, 0xe5b5},
{0x24b8, 0x24ca, 0xe5cd},
{0x24cb, 0x2545, 0xea80},
{0x2839, 0x284b, 0xeafb},
{0x2546, 0x25c0, 0xeb0e},
+   {0x25c1, 0x25c6, 0xeb89},
 };

 const unsigned short mbfl_sb2uni_pua[6][3] = {
{0x27a9, 0x2802, 0xe101},
-   {0x2808, 0x285a, 0xe201},
+   {0x2808, 0x2861, 0xe201},
{0x2921, 0x297a, 0xe001},
{0x2980, 0x29cc, 0xe301},
{0x2a99, 0x2ae4, 0xe401},
-   {0x2af8, 0x2b2f, 0xe501},
+   {0x2af8, 0x2b35, 0xe501},
 };

 const unsigned short mbfl_kddi2uni_pua_b[8][3] = {
{0x24b8, 0x24f6, 0xec40},
{0x24f7, 0x2573, 0xec80},
{0x2574, 0x25b2, 0xed40},
-   {0x25b3, 0x25c0, 0xed80},
+   {0x25b3, 0x25c6, 0xed80},
{0x26ec, 0x272a, 0xef40},
{0x272b, 0x27a7, 0xef80},
{0x27a8, 0x27e6, 0xf040},

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-11-02 14:49:41 UTC (rev 318689)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h   
2011-11-02 14:51:39 UTC (rev 318690)
@@ -48,7 +48,7 @@
 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_kddi2uni_pua[7][3];
 extern const unsigned short mbfl_sb2uni_pua[6][3];
 extern const unsigned short mbfl_kddi2uni_pua_b[8][3];


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-11-02 14:49:41 UTC (rev 318689)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c   
2011-11-02 14:51:39 UTC (rev 318690)
@@ -213,7 +213,7 @@
mbfilter_conv_r_map_tbl(s, s1, 
mbfl_docomo2uni_pua, 4)  0) {
s = 
mbfilter_sjis_emoji_docomo2unicode(s1, snd);
} else if (filter-from-no_encoding == 
mbfl_no_encoding_utf8_kddi_a 
-  mbfilter_conv_r_map_tbl(s, 
s1, mbfl_kddi2uni_pua, 6)  0) {
+  mbfilter_conv_r_map_tbl(s, 
s1, mbfl_kddi2uni_pua, 7)  0) {
s = 
mbfilter_sjis_emoji_kddi2unicode(s1, snd);
} else if (filter-from-no_encoding == 
mbfl_no_encoding_utf8_kddi_b 

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.c mbfilter_sjis_mobile.h mbfilter_utf8_mobile.c

2011-11-02 Thread Rui Hirokawa
hirokawa Wed, 02 Nov 2011 14:51:56 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318691

Log:
MFH: fixed alias and encoding mapping for emoji logo.

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
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.c
===
--- 
php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
2011-11-02 14:51:39 UTC (rev 318690)
+++ 
php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
2011-11-02 14:51:56 UTC (rev 318691)
@@ -52,7 +52,7 @@
mbfl_no_encoding_sjis_docomo,
SJIS-Mobile#DOCOMO,
Shift_JIS,
-   mbfl_encoding_sjis_docomo_aliases,
+   (const char *(*)[])mbfl_encoding_sjis_docomo_aliases,
mblen_table_sjis,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
 };
@@ -61,7 +61,7 @@
mbfl_no_encoding_sjis_kddi,
SJIS-Mobile#KDDI,
Shift_JIS,
-   mbfl_encoding_sjis_kddi_aliases,
+   (const char *(*)[])mbfl_encoding_sjis_kddi_aliases,
mblen_table_sjis,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
 };
@@ -70,7 +70,7 @@
mbfl_no_encoding_sjis_sb,
SJIS-Mobile#SOFTBANK,
Shift_JIS,
-   mbfl_encoding_sjis_sb_aliases,
+   (const char *(*)[])mbfl_encoding_sjis_sb_aliases,
mblen_table_sjis,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
 };
@@ -155,35 +155,36 @@
 static const int nflags_code_sb[10] = {0x2b0a, 0x2b05, 0x2b08, 0x2b04, 0x2b07, 
0x2b06, 0x2b02, 0x2b0b, 0x2b09, 0x2b03};

 const unsigned short mbfl_docomo2uni_pua[4][3] = {
-   {0x28c2, 0x2929, 0xe63e},
-   {0x2930, 0x2932, 0xe6ac},
-   {0x2935, 0x293e, 0xe6b1},
+   {0x28c2, 0x292f, 0xe63e},
+   {0x2930, 0x2934, 0xe6ac},
+   {0x2935, 0x2951, 0xe6b1},
{0x2952, 0x29db, 0xe6ce},
 };

-const unsigned short mbfl_kddi2uni_pua[6][3] = {
+const unsigned short mbfl_kddi2uni_pua[7][3] = {
{0x26ec, 0x2838, 0xe468},
{0x284c, 0x2863, 0xe5b5},
{0x24b8, 0x24ca, 0xe5cd},
{0x24cb, 0x2545, 0xea80},
{0x2839, 0x284b, 0xeafb},
{0x2546, 0x25c0, 0xeb0e},
+   {0x25c1, 0x25c6, 0xeb89},
 };

 const unsigned short mbfl_sb2uni_pua[6][3] = {
{0x27a9, 0x2802, 0xe101},
-   {0x2808, 0x285a, 0xe201},
+   {0x2808, 0x2861, 0xe201},
{0x2921, 0x297a, 0xe001},
{0x2980, 0x29cc, 0xe301},
{0x2a99, 0x2ae4, 0xe401},
-   {0x2af8, 0x2b2f, 0xe501},
+   {0x2af8, 0x2b35, 0xe501},
 };

 const unsigned short mbfl_kddi2uni_pua_b[8][3] = {
{0x24b8, 0x24f6, 0xec40},
{0x24f7, 0x2573, 0xec80},
{0x2574, 0x25b2, 0xed40},
-   {0x25b3, 0x25c0, 0xed80},
+   {0x25b3, 0x25c6, 0xed80},
{0x26ec, 0x272a, 0xef40},
{0x272b, 0x27a7, 0xef80},
{0x27a8, 0x27e6, 0xf040},

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-11-02 14:51:39 UTC (rev 318690)
+++ 
php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.h
2011-11-02 14:51:56 UTC (rev 318691)
@@ -48,7 +48,7 @@
 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_kddi2uni_pua[7][3];
 extern const unsigned short mbfl_sb2uni_pua[6][3];
 extern const unsigned short mbfl_kddi2uni_pua_b[8][3];


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-11-02 14:51:39 UTC (rev 318690)
+++ 
php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c
2011-11-02 14:51:56 UTC (rev 318691)
@@ -213,7 +213,7 @@
mbfilter_conv_r_map_tbl(s, s1, 
mbfl_docomo2uni_pua, 4)  0) {
s = 
mbfilter_sjis_emoji_docomo2unicode(s1, snd);
} else if (filter-from-no_encoding == 
mbfl_no_encoding_utf8_kddi_a 
-  mbfilter_conv_r_map_tbl(s, 
s1, mbfl_kddi2uni_pua, 6)  0) {
+  mbfilter_conv_r_map_tbl(s, 
s1, mbfl_kddi2uni_pua, 7)  0) {
s = 
mbfilter_sjis_emoji_kddi2unicode(s1, snd);
  

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_utf8_mobile.c

2011-10-30 Thread Rui Hirokawa
hirokawa Sun, 30 Oct 2011 08:40:22 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318575

Log:
fixed alias of encoding.

Changed paths:
U   php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c

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-10-30 08:36:18 UTC (rev 318574)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c   
2011-10-30 08:40:22 UTC (rev 318575)
@@ -41,7 +41,7 @@
 extern const unsigned char mblen_table_utf8[];

 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_a_aliases[] = {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};


-- 
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_mobile.c

2011-10-30 Thread Rui Hirokawa
hirokawa Sun, 30 Oct 2011 08:40:51 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318576

Log:
MFH: fixed alias of encoding.

Changed paths:
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_mobile.c
===
--- 
php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c
2011-10-30 08:40:22 UTC (rev 318575)
+++ 
php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c
2011-10-30 08:40:51 UTC (rev 318576)
@@ -41,7 +41,7 @@
 extern const unsigned char mblen_table_utf8[];

 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_a_aliases[] = {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};


-- 
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/ exec.c tests/general_functions/bug60116.phpt

2011-10-29 Thread Rui Hirokawa
hirokawa Sun, 30 Oct 2011 05:57:26 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318568

Log:
added a test script for bug60116 and fixed behabior of ESCAPE_CMD_END.

Bug: https://bugs.php.net/60116 (To be documented) escapeshellcmd() cannot 
escape the chars which causes shell injection.
  
Changed paths:
U   php/php-src/trunk/ext/standard/exec.c
A   php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt

Modified: php/php-src/trunk/ext/standard/exec.c
===
--- php/php-src/trunk/ext/standard/exec.c   2011-10-30 01:45:29 UTC (rev 
318567)
+++ php/php-src/trunk/ext/standard/exec.c   2011-10-30 05:57:26 UTC (rev 
318568)
@@ -280,7 +280,7 @@
cmd[y++] = '\\';
cmd[y++] = str[x];
} else if (flag == ESCAPE_CMD_END) {
-   if (x == 0 || x == l - 1) {
+   if ((x == 0 || x == l - 1)  (str[0] 
== str[l-1])) {
cmd[y++] = str[x];
 } else {
 cmd[y++] = '\\';

Added: php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt
===
--- php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/general_functions/bug60116.phpt
2011-10-30 05:57:26 UTC (rev 318568)
@@ -0,0 +1,160 @@
+--TEST--
+Test escapeshellcmd() to escape the quotation
+--SKIPIF--
+?php
+if( substr(PHP_OS, 0, 3) == 'WIN' ) {
+   die('skip...Invalid for Windows');
+}
+?
+--FILE--
+?php
+echo *** Testing escapeshellcmd() escape the quotation ***\n;
+$data = array(
+   'abc',
+   'abc,
+   '?',
+   '()[]{}$',
+   '%^',
+   '#;`|*?',
+   '~\\',
+   '%NOENV%',
+   abc' 'def,
+   'abc def',
+   'abc def',
+   'abc def',
+);
+
+echo case: default\n;
+
+$count = 1;
+foreach ($data AS $value) {
+   echo -- Test  . $count++ .  --\n;
+   var_dump(escapeshellcmd($value));
+}
+
+echo case: ESCAPE_CMD_PAIR\n;
+$count = 1;
+foreach ($data AS $value) {
+   echo -- Test  . $count++ .  --\n;
+   var_dump(escapeshellcmd($value, ESCAPE_CMD_PAIR));
+}
+
+echo case: ESCAPE_CMD_END\n;
+$count = 1;
+foreach ($data AS $value) {
+   echo -- Test  . $count++ .  --\n;
+   var_dump(escapeshellcmd($value, ESCAPE_CMD_END));
+}
+
+echo case: ESCAPE_CMD_ALL\n;
+$count = 1;
+foreach ($data AS $value) {
+   echo -- Test  . $count++ .  --\n;
+   var_dump(escapeshellcmd($value, ESCAPE_CMD_ALL));
+}
+
+echo Done\n;
+?
+--EXPECTF--
+*** Testing escapeshellcmd() escape the quotation ***
+case: default
+-- Test 1 --
+string(5) \abc
+-- Test 2 --
+string(5) \'abc
+-- Test 3 --
+string(6) \?\\
+-- Test 4 --
+string(14) \(\)\[\]\{\}\$
+-- Test 5 --
+string(3) %\^
+-- Test 6 --
+string(14) \#\\;\`\|\*\?
+-- Test 7 --
+string(8) \~
+-- Test 8 --
+string(7) %NOENV%
+-- Test 9 --
+string(9) abc' 'def
+-- Test 10 --
+string(9) abc def
+-- Test 11 --
+string(9) 'abc def'
+-- Test 12 --
+string(9) abc def
+case: ESCAPE_CMD_PAIR
+-- Test 1 --
+string(5) \abc
+-- Test 2 --
+string(5) \'abc
+-- Test 3 --
+string(6) \?\\
+-- Test 4 --
+string(14) \(\)\[\]\{\}\$
+-- Test 5 --
+string(3) %\^
+-- Test 6 --
+string(14) \#\\;\`\|\*\?
+-- Test 7 --
+string(8) \~
+-- Test 8 --
+string(7) %NOENV%
+-- Test 9 --
+string(9) abc' 'def
+-- Test 10 --
+string(9) abc def
+-- Test 11 --
+string(9) 'abc def'
+-- Test 12 --
+string(9) abc def
+case: ESCAPE_CMD_END
+-- Test 1 --
+string(5) \abc
+-- Test 2 --
+string(5) \'abc
+-- Test 3 --
+string(6) \?\\
+-- Test 4 --
+string(14) \(\)\[\]\{\}\$
+-- Test 5 --
+string(3) %\^
+-- Test 6 --
+string(14) \#\\;\`\|\*\?
+-- Test 7 --
+string(8) \~
+-- Test 8 --
+string(7) %NOENV%
+-- Test 9 --
+string(11) abc\' \'def
+-- Test 10 --
+string(11) abc\ \def
+-- Test 11 --
+string(9) 'abc def'
+-- Test 12 --
+string(9) abc def
+case: ESCAPE_CMD_ALL
+-- Test 1 --
+string(5) \abc
+-- Test 2 --
+string(5) \'abc
+-- Test 3 --
+string(6) \?\\
+-- Test 4 --
+string(14) \(\)\[\]\{\}\$
+-- Test 5 --
+string(3) %\^
+-- Test 6 --
+string(14) \#\\;\`\|\*\?
+-- Test 7 --
+string(8) \~
+-- Test 8 --
+string(7) %NOENV%
+-- Test 9 --
+string(11) abc\' \'def
+-- Test 10 --
+string(11) abc\ \def
+-- Test 11 --
+string(11) \'abc def\'
+-- Test 12 --
+string(11) \abc def\
+Done


Property changes on: 
php/php-src/trunk/ext/standard/tests/general_functions/bug60116.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

Re: [PHP-CVS] svn: /php/php-src/trunk/ext/standard/ basic_functions.c exec.c exec.h

2011-10-24 Thread Rui Hirokawa

Hi Pierre,

I only tested on Linux.

This patch is not related to Win32, because the quotation is always
escaped on Win32.

I will add the test script within couple of days,
and I will updated the document soon.

Rui

Pierre Joye wrote:
 hi Rui,
 
 Did you test it that on other platforms than linux?
 
 It will also be nice to add tests case for this as this function
 (actually both escape args and cmds) has suffered from lack of testing
 on all platforms in the last php releases.
 
 Btw, update the upgrading guide too :)
 
 On Sun, Oct 23, 2011 at 3:49 PM, Rui Hirokawa hirok...@php.net wrote:
 hirokawa Sun, 23 Oct 2011 13:49:54 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=318342

 Log:
 fixed bug #60116 escapeshellcmd() cannot escape the dangerous quotes.

 Bug: https://bugs.php.net/60116 (Open) escapeshellcmd() cannot escape the 
 chars which causes shell injection.

 Changed paths:
U   php/php-src/trunk/ext/standard/basic_functions.c
U   php/php-src/trunk/ext/standard/exec.c
U   php/php-src/trunk/ext/standard/exec.h


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c

2011-10-23 Thread Rui Hirokawa
Hello, Moriyoshi,

It is because 0xf5-0xf7 is the invalid four byte UTF-8 sequence.

ref: http://en.wikipedia.org/wiki/UTF-8

Rui

Moriyoshi Koizumi wrote:
 Rui, what is the reason behind this change?
 
 Moriyoshi
 
 On 2011/10/18, at 23:04, Rui Hirokawa wrote:
 
 hirokawa Tue, 18 Oct 2011 14:04:13 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=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 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

2011-10-23 Thread Rui Hirokawa
hirokawa Sun, 23 Oct 2011 11:54:06 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318340

Log:
removed invalid two byte sequenct for 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-23 11:09:40 UTC (rev 318339)
+++ php/php-src/trunk/ext/mbstring/libmbfl/filters/mbfilter_utf8.c  
2011-10-23 11:54:06 UTC (rev 318340)
@@ -49,8 +49,8 @@
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+   1, 1, 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, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 };

-- 
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

2011-10-23 Thread Rui Hirokawa
hirokawa Sun, 23 Oct 2011 11:54:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318341

Log:
MFH: removed invalid two byte sequenct for 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-23 11:54:06 UTC (rev 318340)
+++ php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/mbfilter_utf8.c   
2011-10-23 11:54:34 UTC (rev 318341)
@@ -49,8 +49,8 @@
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+   1, 1, 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, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 };

-- 
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 exec.c exec.h

2011-10-23 Thread Rui Hirokawa
hirokawa Sun, 23 Oct 2011 13:49:54 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=318342

Log:
fixed bug #60116 escapeshellcmd() cannot escape the dangerous quotes.

Bug: https://bugs.php.net/60116 (Open) escapeshellcmd() cannot escape the chars 
which causes shell injection.
  
Changed paths:
U   php/php-src/trunk/ext/standard/basic_functions.c
U   php/php-src/trunk/ext/standard/exec.c
U   php/php-src/trunk/ext/standard/exec.h

Modified: php/php-src/trunk/ext/standard/basic_functions.c
===
--- php/php-src/trunk/ext/standard/basic_functions.c2011-10-23 11:54:34 UTC 
(rev 318341)
+++ php/php-src/trunk/ext/standard/basic_functions.c2011-10-23 13:49:54 UTC 
(rev 318342)
@@ -3614,6 +3614,7 @@
 #endif

register_phpinfo_constants(INIT_FUNC_ARGS_PASSTHRU);
+   register_exec_constants(INIT_FUNC_ARGS_PASSTHRU);
register_html_constants(INIT_FUNC_ARGS_PASSTHRU);
register_string_constants(INIT_FUNC_ARGS_PASSTHRU);


Modified: php/php-src/trunk/ext/standard/exec.c
===
--- php/php-src/trunk/ext/standard/exec.c   2011-10-23 11:54:34 UTC (rev 
318341)
+++ php/php-src/trunk/ext/standard/exec.c   2011-10-23 13:49:54 UTC (rev 
318342)
@@ -50,6 +50,16 @@
 #include unistd.h
 #endif

+/* {{{ register_exec_constants
+ *  */
+void register_exec_constants(INIT_FUNC_ARGS)
+{
+REGISTER_LONG_CONSTANT(ESCAPE_CMD_PAIR, ESCAPE_CMD_PAIR, 
CONST_PERSISTENT|CONST_CS);
+REGISTER_LONG_CONSTANT(ESCAPE_CMD_END, ESCAPE_CMD_END, 
CONST_PERSISTENT|CONST_CS);
+REGISTER_LONG_CONSTANT(ESCAPE_CMD_ALL, ESCAPE_CMD_ALL, 
CONST_PERSISTENT|CONST_CS);
+}
+/* }}} */
+
 /* {{{ php_exec
  * If type==0, only last line of output is returned (exec)
  * If type==1, all lines will be printed and last lined returned (system)
@@ -238,7 +248,7 @@

*NOT* safe for binary strings
 */
-PHPAPI char *php_escape_shell_cmd(char *str)
+PHPAPI char *php_escape_shell_cmd_ex(char *str, int flag)
 {
register int x, y, l = strlen(str);
char *cmd;
@@ -266,14 +276,26 @@
 #ifndef PHP_WIN32
case '':
case '\'':
-   if (!p  (p = memchr(str + x + 1, str[x], l - 
x - 1))) {
-   /* noop */
-   } else if (p  *p == str[x]) {
-   p = NULL;
-   } else {
+   if (flag == ESCAPE_CMD_ALL) {
cmd[y++] = '\\';
+   cmd[y++] = str[x];
+   } else if (flag == ESCAPE_CMD_END) {
+   if (x == 0 || x == l - 1) {
+   cmd[y++] = str[x];
+} else {
+cmd[y++] = '\\';
+cmd[y++] = str[x];
+}
+   } else { /* ESCAPE_CMD_PAIR */
+   if (!p  (p = memchr(str + x + 1, 
str[x], l - x - 1))) {
+   /* noop */
+   } else if (p  *p == str[x]) {
+   p = NULL;
+   } else {
+   cmd[y++] = '\\';
+   }
+   cmd[y++] = str[x];
}
-   cmd[y++] = str[x];
break;
 #else
/* % is Windows specific for enviromental variables, 
^%PATH% will
@@ -327,6 +349,14 @@
 }
 /* }}} */

+/* {{{ php_escape_shell_cmd
+ */
+PHPAPI char *php_escape_shell_cmd(char *str)
+{
+return php_escape_shell_cmd_ex(str, ESCAPE_CMD_PAIR);
+}
+/* }}} */
+
 /* {{{ php_escape_shell_arg
  */
 PHPAPI char *php_escape_shell_arg(char *str)
@@ -397,14 +427,15 @@
 {
char *command;
int command_len;
+   long flag = ESCAPE_CMD_PAIR;
char *cmd = NULL;

-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, command, 
command_len) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|l, command, 
command_len, flag) == FAILURE) {
return;
}

if (command_len) {
-   cmd = php_escape_shell_cmd(command);
+   cmd = php_escape_shell_cmd_ex(command, flag);
RETVAL_STRING(cmd, 0);
} else {
RETVAL_EMPTY_STRING();

Modified: php/php-src/trunk/ext/standard/exec.h
===
--- php/php-src/trunk/ext/standard/exec.h   2011-10-23 11:54:34 UTC (rev 
318341)
+++ 

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_utf8.c

2011-10-18 Thread Rui Hirokawa
hirokawa Tue, 18 Oct 2011 14:03:44 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-10-18 Thread Rui Hirokawa
hirokawa Tue, 18 Oct 2011 14:04:13 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-10-18 Thread Rui Hirokawa
hirokawa Tue, 18 Oct 2011 14:28:01 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-10-18 Thread Rui Hirokawa
hirokawa Tue, 18 Oct 2011 14:28:21 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ emoji2uni.h

2011-10-15 Thread Rui Hirokawa
hirokawa Sat, 15 Oct 2011 07:12:02 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-10-15 Thread Rui Hirokawa
hirokawa Sat, 15 Oct 2011 07:14:45 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-10-15 Thread Rui Hirokawa
hirokawa Sat, 15 Oct 2011 08:55:53 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

diffs exceeded maximum size
-- 
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

2011-09-25 Thread Rui Hirokawa
hirokawa Sun, 25 Sep 2011 08:01:54 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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_dtor(v);
+  

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ mbstring.c php_mbregex.c php_mbregex.h

2011-09-25 Thread Rui Hirokawa
hirokawa Sun, 25 Sep 2011 08:15:50 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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 @@
/* Clean up */
   

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ mbstring.c php_mbregex.c php_mbregex.h

2011-09-25 Thread Rui Hirokawa
hirokawa Sun, 25 Sep 2011 08:22:58 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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 @@
/* Clean up */
   

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ php_mbregex.c

2011-09-25 Thread Rui Hirokawa
hirokawa Sun, 25 Sep 2011 08:33:43 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-09-25 Thread Rui Hirokawa
hirokawa Sun, 25 Sep 2011 08:55:27 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
+?php
+extension_loaded('mbstring') or die('skip mbstring not available');
+function_exists('mb_ereg_replace_callback') or die(skip 
mb_ereg_replace_callback() is not available in this build);
+?
+--FILE--
+?php
+$str = 'abc 123 #,; $foo';
+echo mb_ereg_replace_callback('(\S+)', function($m){return 
$m[1].'('.strlen($m[1]).')';}, $str);
+?
+--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/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.c

2011-09-23 Thread Rui Hirokawa
hirokawa Fri, 23 Sep 2011 11:08:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-09-23 Thread Rui Hirokawa
hirokawa Fri, 23 Sep 2011 11:09:33 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+mb_substitute_character(0x3f);
+
+echo SJIS-Mobile to Unicode\n;
+var_dump(bin2hex(mb_convert_encoding(\xf8\x9f, UCS-4BE, SJIS-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xf6\x60, UCS-4BE, SJIS-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xf9\x8b, UCS-4BE, SJIS-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xf9\xe6, UCS-4BE, SJIS-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xf6\xec, UCS-4BE, SJIS-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xf7\x50, UCS-4BE, SJIS-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xf9\x85, UCS-4BE, SJIS-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xf4\x89, UCS-4BE, SJIS-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xf7\xb0, UCS-4BE, SJIS-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xf3\xd2, UCS-4BE, SJIS-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xfb\xb3, UCS-4BE, SJIS-Mobile#SOFTBANK)));
+
+echo Unicode to SJIS-Mobile\n;
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, SJIS-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, SJIS-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, SJIS-Mobile#SOFTBANK, UCS-4BE)));
+
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf3\x40, SJIS-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf3\x40, SJIS-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf3\x40, SJIS-Mobile#SOFTBANK, UCS-4BE)));
+
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x00\x23\x00\x00\x20\xe3, SJIS-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x00\x23\x00\x00\x20\xe3, SJIS-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x00\x23\x00\x00\x20\xe3, SJIS-Mobile#SOFTBANK, UCS-4BE)));
+
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf1\xe8\x00\x01\xf1\xf3, SJIS-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf1\xe8\x00\x01\xf1\xf3, SJIS-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf1\xe8\x00\x01\xf1\xf3, SJIS-Mobile#SOFTBANK, UCS-4BE)));
+
+echo UTF-8-Mobile to Unicode\n;
+var_dump(bin2hex(mb_convert_encoding(\xee\x98\xbe, UCS-4BE, UTF-8-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xee\xbd\xa0, UCS-4BE, UTF-8-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xee\x81\x8a, UCS-4BE, UTF-8-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xee\x9d\x81, UCS-4BE, UTF-8-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xee\xbf\xac, UCS-4BE, UTF-8-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xee\x84\x90, UCS-4BE, UTF-8-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xee\x9b\xa0, UCS-4BE, UTF-8-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xee\xb6\x89, UCS-4BE, UTF-8-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xee\x88\x90, UCS-4BE, UTF-8-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xee\xb3\x92, UCS-4BE, UTF-8-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xee\x94\x93, UCS-4BE, UTF-8-Mobile#SOFTBANK)));
+
+echo Unicode to UTF8-Mobile\n;
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, UTF-8-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, UTF-8-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, UTF-8-Mobile#SOFTBANK, UCS-4BE)));
+
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf3\x40, UTF-8-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf3\x40, UTF-8-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf3\x40, UTF-8-Mobile#SOFTBANK, UCS-4BE)));
+
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x00\x23\x00\x00\x20\xe3, UTF-8-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x00\x23\x00\x00\x20\xe3, UTF-8-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x00\x23\x00\x00\x20\xe3, UTF-8-Mobile#SOFTBANK, UCS-4BE)));
+
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf1\xe8\x00\x01\xf1\xf3, UTF-8-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf1\xe8\x00\x01\xf1\xf3, UTF-8-Mobile#KDDI, 

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/ libmbfl/filters/mbfilter_sjis_mobile.c tests/pictogram1.phpt

2011-09-23 Thread Rui Hirokawa
hirokawa Fri, 23 Sep 2011 11:11:38 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+mb_substitute_character(0x3f);
+
+echo SJIS-Mobile to Unicode\n;
+var_dump(bin2hex(mb_convert_encoding(\xf8\x9f, UCS-4BE, SJIS-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xf6\x60, UCS-4BE, SJIS-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xf9\x8b, UCS-4BE, SJIS-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xf9\xe6, UCS-4BE, SJIS-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xf6\xec, UCS-4BE, SJIS-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xf7\x50, UCS-4BE, SJIS-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xf9\x85, UCS-4BE, SJIS-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xf4\x89, UCS-4BE, SJIS-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xf7\xb0, UCS-4BE, SJIS-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xf3\xd2, UCS-4BE, SJIS-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xfb\xb3, UCS-4BE, SJIS-Mobile#SOFTBANK)));
+
+echo Unicode to SJIS-Mobile\n;
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, SJIS-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, SJIS-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, SJIS-Mobile#SOFTBANK, UCS-4BE)));
+
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf3\x40, SJIS-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf3\x40, SJIS-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf3\x40, SJIS-Mobile#SOFTBANK, UCS-4BE)));
+
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x00\x23\x00\x00\x20\xe3, SJIS-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x00\x23\x00\x00\x20\xe3, SJIS-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x00\x23\x00\x00\x20\xe3, SJIS-Mobile#SOFTBANK, UCS-4BE)));
+
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf1\xe8\x00\x01\xf1\xf3, SJIS-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf1\xe8\x00\x01\xf1\xf3, SJIS-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x01\xf1\xe8\x00\x01\xf1\xf3, SJIS-Mobile#SOFTBANK, UCS-4BE)));
+
+echo UTF-8-Mobile to Unicode\n;
+var_dump(bin2hex(mb_convert_encoding(\xee\x98\xbe, UCS-4BE, UTF-8-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xee\xbd\xa0, UCS-4BE, UTF-8-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xee\x81\x8a, UCS-4BE, UTF-8-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xee\x9d\x81, UCS-4BE, UTF-8-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xee\xbf\xac, UCS-4BE, UTF-8-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xee\x84\x90, UCS-4BE, UTF-8-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xee\x9b\xa0, UCS-4BE, UTF-8-Mobile#DOCOMO)));
+var_dump(bin2hex(mb_convert_encoding(\xee\xb6\x89, UCS-4BE, UTF-8-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xee\x88\x90, UCS-4BE, UTF-8-Mobile#SOFTBANK)));
+
+var_dump(bin2hex(mb_convert_encoding(\xee\xb3\x92, UCS-4BE, UTF-8-Mobile#KDDI)));
+var_dump(bin2hex(mb_convert_encoding(\xee\x94\x93, UCS-4BE, UTF-8-Mobile#SOFTBANK)));
+
+echo Unicode to UTF8-Mobile\n;
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, UTF-8-Mobile#DOCOMO, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, UTF-8-Mobile#KDDI, UCS-4BE)));
+var_dump(bin2hex(mb_convert_encoding(\x00\x00\x26\x00, UTF-8-Mobile#SOFTBANK, UCS-4BE)));
+

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/mbfl/ mbfilter.c

2011-09-23 Thread Rui Hirokawa
hirokawa Sat, 24 Sep 2011 02:11:18 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-09-23 Thread Rui Hirokawa
hirokawa Sat, 24 Sep 2011 02:11:48 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+$map = array(0, 0x10, 0, 0xFF);
+var_dump(mb_decode_numericentity('', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('#', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('#x', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('#61', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('#x3d', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('#61;', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('#x3d;', $map, 'UTF-8'));
+?
+--EXPECTF--
+string(1) 
+string(3) 
+string(2) #
+string(3) #x
+string(4) #61
+string(5) #x3D
+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

2011-09-23 Thread Rui Hirokawa
hirokawa Sat, 24 Sep 2011 02:12:17 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mbstring/ libmbfl/mbfl/mbfilter.c tests/bug40685.phpt

2011-09-23 Thread Rui Hirokawa
hirokawa Sat, 24 Sep 2011 02:20:38 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--FILE--
+?php
+$map = array(0, 0x10, 0, 0xFF);
+var_dump(mb_decode_numericentity('', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('#', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('#61', $map, 'UTF-8'));
+var_dump(mb_decode_numericentity('#61;', $map, 'UTF-8'));
+?
+--EXPECTF--
+string(1) 
+string(3) 
+string(2) #
+string(4) #61
+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

2011-09-12 Thread Rui Hirokawa
hirokawa Mon, 12 Sep 2011 13:20:05 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-09-12 Thread Rui Hirokawa
hirokawa Mon, 12 Sep 2011 13:20:27 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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_utf32.c mbstring.c tests/bug20087.phpt tests/bug28220.phpt tests/bug49536.phpt tests/illformed_utf_sequences.phpt tests/mb_pars

2011-09-11 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 12:12:24 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
 ?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
---XFAIL--
+--FAIL--
 register_globals calls killed the ability for mb_parse_str() to register into the global scope
 --FILE--
 ?php

Modified: php/php-src/trunk/ext/mbstring/tests/bug28220.phpt
===
--- php/php-src/trunk/ext/mbstring/tests/bug28220.phpt	2011-09-11 11:28:12 UTC (rev 316490)
+++ php/php-src/trunk/ext/mbstring/tests/bug28220.phpt	2011-09-11 12:12:24 UTC (rev 316491)
@@ -21,5 +21,5 @@
 }
 ?
 --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	

[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

2011-09-11 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 12:12:48 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
 ?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
---XFAIL--
+--FAIL--
 register_globals calls killed the ability for mb_parse_str() to register into the global scope
 --FILE--
 ?php

Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug28220.phpt
===
--- php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug28220.phpt	2011-09-11 12:12:24 UTC (rev 316491)
+++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/bug28220.phpt	2011-09-11 12:12:48 UTC (rev 316492)
@@ -21,5 +21,5 @@
 }
 ?
 --EXPECT--
-8101
+8085
 63

Modified: 

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ mb_ereg_search_pos.phpt

2011-09-11 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 12:29:00 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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
-
+mb_regex_encoding('iso-8859-1');
 $test_str = 'I�t�rn�ti�n�liz�ti�n';

 if(mb_ereg_search_init($test_str))

-- 
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

2011-09-11 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 12:29:15 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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
-
+mb_regex_encoding('iso-8859-1');
 $test_str = 'I�t�rn�ti�n�liz�ti�n';

 if(mb_ereg_search_init($test_str))

-- 
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

2011-09-11 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 13:04:21 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(neutral)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/trunk/ext/mbstring/tests/mb_send_mail02.phpt
===
--- php/php-src/trunk/ext/mbstring/tests/mb_send_mail02.phpt2011-09-11 
12:29:15 UTC (rev 316494)
+++ php/php-src/trunk/ext/mbstring/tests/mb_send_mail02.phpt2011-09-11 
13:04:21 UTC (rev 316495)
@@ -2,6 +2,9 @@
 mb_send_mail() test 2 (lang=Japanese)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(japanese)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/trunk/ext/mbstring/tests/mb_send_mail03.phpt
===
--- php/php-src/trunk/ext/mbstring/tests/mb_send_mail03.phpt2011-09-11 
12:29:15 UTC (rev 316494)
+++ php/php-src/trunk/ext/mbstring/tests/mb_send_mail03.phpt2011-09-11 
13:04:21 UTC (rev 316495)
@@ -2,6 +2,9 @@
 mb_send_mail() test 3 (lang=English)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(english)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/trunk/ext/mbstring/tests/mb_send_mail04.phpt
===
--- php/php-src/trunk/ext/mbstring/tests/mb_send_mail04.phpt2011-09-11 
12:29:15 UTC (rev 316494)
+++ php/php-src/trunk/ext/mbstring/tests/mb_send_mail04.phpt2011-09-11 
13:04:21 UTC (rev 316495)
@@ -2,6 +2,9 @@
 mb_send_mail() test 4 (lang=German)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(german)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/trunk/ext/mbstring/tests/mb_send_mail05.phpt
===
--- php/php-src/trunk/ext/mbstring/tests/mb_send_mail05.phpt2011-09-11 
12:29:15 UTC (rev 316494)
+++ php/php-src/trunk/ext/mbstring/tests/mb_send_mail05.phpt2011-09-11 
13:04:21 UTC (rev 316495)
@@ -2,6 +2,9 @@
 mb_send_mail() test 5 (lang=Simplified Chinese)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(Simplified Chinese)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/trunk/ext/mbstring/tests/mb_send_mail06.phpt
===
--- php/php-src/trunk/ext/mbstring/tests/mb_send_mail06.phpt2011-09-11 
12:29:15 UTC (rev 316494)
+++ php/php-src/trunk/ext/mbstring/tests/mb_send_mail06.phpt2011-09-11 
13:04:21 UTC (rev 316495)
@@ -2,6 +2,9 @@
 mb_send_mail() test 6 (lang=Traditional Chinese)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(Traditional Chinese)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/trunk/ext/mbstring/tests/mb_send_mail07.phpt
===
--- php/php-src/trunk/ext/mbstring/tests/mb_send_mail07.phpt2011-09-11 
12:29:15 UTC (rev 316494)
+++ php/php-src/trunk/ext/mbstring/tests/mb_send_mail07.phpt2011-09-11 
13:04:21 UTC (rev 316495)
@@ -2,6 +2,9 @@
 mb_send_mail() test 7 (lang=Korean)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(Korean)) {
die(skip mb_send_mail() not available);
 }

-- 
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.

2011-09-11 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 13:04:38 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(neutral)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail02.phpt
===
--- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail02.phpt 
2011-09-11 13:04:21 UTC (rev 316495)
+++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail02.phpt 
2011-09-11 13:04:38 UTC (rev 316496)
@@ -2,6 +2,9 @@
 mb_send_mail() test 2 (lang=Japanese)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(japanese)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail03.phpt
===
--- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail03.phpt 
2011-09-11 13:04:21 UTC (rev 316495)
+++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail03.phpt 
2011-09-11 13:04:38 UTC (rev 316496)
@@ -2,6 +2,9 @@
 mb_send_mail() test 3 (lang=English)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(english)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail04.phpt
===
--- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail04.phpt 
2011-09-11 13:04:21 UTC (rev 316495)
+++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail04.phpt 
2011-09-11 13:04:38 UTC (rev 316496)
@@ -2,6 +2,9 @@
 mb_send_mail() test 4 (lang=German)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(german)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail05.phpt
===
--- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail05.phpt 
2011-09-11 13:04:21 UTC (rev 316495)
+++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail05.phpt 
2011-09-11 13:04:38 UTC (rev 316496)
@@ -2,6 +2,9 @@
 mb_send_mail() test 5 (lang=Simplified Chinese)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(Simplified Chinese)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail06.phpt
===
--- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail06.phpt 
2011-09-11 13:04:21 UTC (rev 316495)
+++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail06.phpt 
2011-09-11 13:04:38 UTC (rev 316496)
@@ -2,6 +2,9 @@
 mb_send_mail() test 6 (lang=Traditional Chinese)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(Traditional Chinese)) {
die(skip mb_send_mail() not available);
 }

Modified: php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail07.phpt
===
--- php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail07.phpt 
2011-09-11 13:04:21 UTC (rev 316495)
+++ php/php-src/branches/PHP_5_4/ext/mbstring/tests/mb_send_mail07.phpt 
2011-09-11 13:04:38 UTC (rev 316496)
@@ -2,6 +2,9 @@
 mb_send_mail() test 7 (lang=Korean)
 --SKIPIF--
 ?php
+if(substr(PHP_OS, 0, 3) 

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ bug52861.phpt

2011-09-11 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 13:15:40 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(neutral)) {
die(skip mb_send_mail() not available);
 }

-- 
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

2011-09-11 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 13:15:48 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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
+if(substr(PHP_OS, 0, 3) == WIN) {
+  die(skip Won't run on Windows);
+}
 if (!function_exists(mb_send_mail) || !mb_language(neutral)) {
die(skip mb_send_mail() not available);
 }

-- 
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

2011-09-10 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 02:16:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
-?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
---XFAIL--
-register_globals calls killed the ability for mb_parse_str() to register into 
the global scope
---FILE--
-?php
-ini_set('include_path', dirname(__FILE__));
-include_once('common.inc');
-$testmoo = blah blah;
-var_dump(mb_parse_str(testmoo));
-var_dump($testmoo);
-var_dump(mb_parse_str(test=moo));
-var_dump($test);
-?
---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

2011-09-10 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 02:16:58 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
-?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
---XFAIL--
-register_globals calls killed the ability for mb_parse_str() to register into 
the global scope
---FILE--
-?php
-ini_set('include_path', dirname(__FILE__));
-include_once('common.inc');
-$testmoo = blah blah;
-var_dump(mb_parse_str(testmoo));
-var_dump($testmoo);
-var_dump(mb_parse_str(test=moo));
-var_dump($test);
-?
---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

2011-09-10 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 03:55:08 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--XFAIL--
+register_globals calls killed the ability for mb_parse_str() to register into 
the global scope
+--FILE--
+?php
+ini_set('include_path', dirname(__FILE__));
+include_once('common.inc');
+$testmoo = blah blah;
+var_dump(mb_parse_str(testmoo));
+var_dump($testmoo);
+var_dump(mb_parse_str(test=moo));
+var_dump($test);
+?
+--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--
 ?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
---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--
 ?php
+ini_set('include_path', dirname(__FILE__));
+include_once('common.inc');
 $queries = array(
foo=abcbar=def,
%2bfoo=def-bar=jkl,
@@ -37,8 +39,9 @@
 }
 string(0) 
 string(0) 
-string(3) abc
-string(3) def
+ERR: Warning
+string(0) 
+string(0) 
 array(2) {
   [+foo]=
   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--
 ?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
 --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
+ini_set('include_path', dirname(__FILE__));
+include_once('common.inc');
 $queries = array(
foo=abc#bar=deffubar=ghi,
%2bfoo=def-bar=jkl#+fubar,

-- 
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

2011-09-10 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 03:56:16 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
 ?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
---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--
 ?php
-ini_set('include_path', dirname(__FILE__));
-include_once('common.inc');
 $queries = array(
foo=abcbar=def,
%2bfoo=def-bar=jkl,
@@ -39,9 +37,8 @@
 }
 string(0) 
 string(0) 
-ERR: Warning
-string(0) 
-string(0) 
+string(3) abc
+string(3) def
 array(2) {
   [+foo]=
   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--
 ?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
 --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
-ini_set('include_path', dirname(__FILE__));
-include_once('common.inc');
 $queries = array(
foo=abc#bar=deffubar=ghi,
%2bfoo=def-bar=jkl#+fubar,

-- 
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

2011-09-10 Thread Rui Hirokawa
hirokawa Sun, 11 Sep 2011 03:57:31 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
+?php extension_loaded('mbstring') or die('skip mbstring not available'); ?
+--XFAIL--
+register_globals calls killed the ability for mb_parse_str() to register into 
the global scope
+--FILE--
+?php
+ini_set('include_path', dirname(__FILE__));
+include_once('common.inc');
+$testmoo = blah blah;
+var_dump(mb_parse_str(testmoo));
+var_dump($testmoo);
+var_dump(mb_parse_str(test=moo));
+var_dump($test);
+?
+--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/branches/PHP_5_4/ext/mbstring/ mbstring.c

2011-09-08 Thread Rui Hirokawa
hirokawa Thu, 08 Sep 2011 15:19:18 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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/libmbfl/filters/ mbfilter_utf8.c

2011-09-07 Thread Rui Hirokawa
hirokawa Wed, 07 Sep 2011 14:30:06 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-09-07 Thread Rui Hirokawa
hirokawa Wed, 07 Sep 2011 14:30:38 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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/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

2011-08-31 Thread Rui Hirokawa
hirokawa Wed, 31 Aug 2011 13:18:44 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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_utf8_kddi = {
-	mbfl_no_encoding_utf8_kddi,
+const struct 

[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

2011-08-31 Thread Rui Hirokawa
hirokawa Wed, 31 Aug 2011 13:19:03 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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,
+	(const char *(*)[])mbfl_encoding_utf8_kddi_a_aliases,
 	

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mac.c sjis_mac2uni.h

2011-08-27 Thread Rui Hirokawa
hirokawa Sun, 28 Aug 2011 04:32:22 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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; i12; i++) {
+for (i=0; icode_tbl_m_len; i++) {
 	if (s == code_tbl_m[i][0]) {
 	

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mac.c sjis_mac2uni.h

2011-08-27 Thread Rui Hirokawa
hirokawa Sun, 28 Aug 2011 04:32:33 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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; i12; i++) {
+for (i=0; 

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_mobile.h mbfilter_utf8_mobile.c

2011-08-26 Thread Rui Hirokawa
hirokawa Sat, 27 Aug 2011 00:07:20 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-26 Thread Rui Hirokawa
hirokawa Sat, 27 Aug 2011 00:08:02 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-26 Thread Rui Hirokawa
hirokawa Sat, 27 Aug 2011 01:25:10 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-26 Thread Rui Hirokawa
hirokawa Sat, 27 Aug 2011 01:25:24 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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/ config.m4 config.w32 libmbfl/NEWS libmbfl/filters/Makefile.am libmbfl/filters/mbfilter_big5.c libmbfl/filters/mbfilter_big5.h libmbfl/filters/mbfilter_c

2011-08-20 Thread Rui Hirokawa
hirokawa Sat, 20 Aug 2011 07:24:04 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

diffs exceeded maximum size
-- 
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

2011-08-20 Thread Rui Hirokawa
hirokawa Sat, 20 Aug 2011 07:27:48 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-20 Thread Rui Hirokawa
hirokawa Sat, 20 Aug 2011 07:29:21 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

diffs exceeded maximum size
-- 
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

2011-08-20 Thread Rui Hirokawa
hirokawa Sat, 20 Aug 2011 07:29:59 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-20 Thread Rui Hirokawa
hirokawa Sat, 20 Aug 2011 08:27:57 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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][2] = 

[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_

2011-08-20 Thread Rui Hirokawa
hirokawa Sat, 20 Aug 2011 08:28:40 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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_ctor,
- 	

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_iso2022jp_2004.c mbfilter_sjis_2004.c unicode_table_jis2004.h

2011-08-20 Thread Rui Hirokawa
hirokawa Sun, 21 Aug 2011 02:22:53 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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, filter-data));
 			filter-status = 0;
 		} else {
-			filter-status++;
-			filter-cache = c;
+			

[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

2011-08-20 Thread Rui Hirokawa
hirokawa Sun, 21 Aug 2011 02:23:33 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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-JP-2004 */
 		if ((c = 0  c  0x21) || c == 0x7f) {		/* CTLs */
 			

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/libmbfl/filters/ mbfilter_sjis_2004.c unicode_table_jis2004.h

2011-08-20 Thread Rui Hirokawa
hirokawa Sun, 21 Aug 2011 05:02:21 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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
+  Digbats : U+2700 - U+27BF
+  

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/mbstring/libmbfl/filters/ mbfilter_sjis_2004.c unicode_table_jis2004.h

2011-08-20 Thread Rui Hirokawa
hirokawa Sun, 21 Aug 2011 05:02:33 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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: U+2500 - U+257F
+  

[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

2011-08-14 Thread Rui Hirokawa
hirokawa Sun, 14 Aug 2011 14:09:11 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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 hirok...@php.net 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[] = {gb-18030, gb-18030-2000, NULL};
+
+const mbfl_encoding mbfl_encoding_gb18030

[PHP-CVS] svn: /php/php-src/trunk/ NEWS

2011-08-14 Thread Rui Hirokawa
hirokawa Sun, 14 Aug 2011 14:09:54 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-14 Thread Rui Hirokawa
hirokawa Sun, 14 Aug 2011 14:11:29 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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 hirok...@php.net on 11 Aug 2011.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
+#include mbfilter.h
+#include mbfilter_gb18030.h
+
+#include

[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS

2011-08-14 Thread Rui Hirokawa
hirokawa Sun, 14 Aug 2011 14:11:49 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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.w32

2011-08-13 Thread Rui Hirokawa
hirokawa Sat, 13 Aug 2011 12:53:40 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-13 Thread Rui Hirokawa
hirokawa Sat, 13 Aug 2011 13:17:36 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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/ NEWS

2011-08-09 Thread Rui Hirokawa
hirokawa Tue, 09 Aug 2011 15:11:33 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-09 Thread Rui Hirokawa
hirokawa Tue, 09 Aug 2011 15:11:51 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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/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

2011-08-08 Thread Rui Hirokawa
hirokawa Mon, 08 Aug 2011 16:14:30 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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 cp932ext1_ucs_table[];

[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

2011-08-08 Thread Rui Hirokawa
hirokawa Mon, 08 Aug 2011 16:15:39 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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 (unsigned short));

[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ mb_gpc.c

2011-08-06 Thread Rui Hirokawa
hirokawa Sat, 06 Aug 2011 12:19:16 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-06 Thread Rui Hirokawa
hirokawa Sat, 06 Aug 2011 12:19:33 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-06 Thread Rui Hirokawa
hirokawa Sat, 06 Aug 2011 15:23:06 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

2011-08-06 Thread Rui Hirokawa
hirokawa Sat, 06 Aug 2011 15:24:31 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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/mbfl/ mbfilter.h

2011-08-05 Thread Rui Hirokawa
hirokawa Sat, 06 Aug 2011 01:48:45 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

  1   2   3   >