[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_charset.c trunk/ext/mysqlnd/mysqlnd_charset.c

2010-10-08 Thread Andrey Hristov
andrey   Fri, 08 Oct 2010 09:15:31 +

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

Log:
new collations

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_charset.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_charset.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_charset.c  2010-10-08 
09:07:49 UTC (rev 304199)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_charset.c  2010-10-08 
09:15:31 UTC (rev 304200)
@@ -563,6 +563,7 @@
{ 145, ucs2, ucs2_esperanto_ci, 2, 2, , mysqlnd_mbcharlen_ucs2, 
check_mb_ucs2},
{ 146, ucs2, ucs2_hungarian_ci, 2, 2, , mysqlnd_mbcharlen_ucs2, 
check_mb_ucs2},
{ 147, ucs2, ucs2_sinhala_ci, 2, 2, , mysqlnd_mbcharlen_ucs2, 
check_mb_ucs2},
+   { 149, ucs2, ucs2_croatian_ci, 2, 2, , mysqlnd_mbcharlen_ucs2, 
check_mb_ucs2}, /* MDB */

{ 192, UTF8_MB3, UTF8_MB3_general_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 193, UTF8_MB3, UTF8_MB3_icelandic_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
@@ -584,6 +585,7 @@
{ 209, UTF8_MB3, UTF8_MB3_esperanto_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 210, UTF8_MB3, UTF8_MB3_hungarian_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 211, UTF8_MB3, UTF8_MB3_sinhala_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
+   { 213, UTF8_MB3, UTF8_MB3_croatian_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, /*MDB*/

{ 224, UTF8_MB4, UTF8_MB4_unicode_ci, 1, 4, , 
mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 225, UTF8_MB4, UTF8_MB4_icelandic_ci, 1, 4, , 
mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c 2010-10-08 09:07:49 UTC 
(rev 304199)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_charset.c 2010-10-08 09:15:31 UTC 
(rev 304200)
@@ -563,6 +563,7 @@
{ 145, ucs2, ucs2_esperanto_ci, 2, 2, , mysqlnd_mbcharlen_ucs2, 
check_mb_ucs2},
{ 146, ucs2, ucs2_hungarian_ci, 2, 2, , mysqlnd_mbcharlen_ucs2, 
check_mb_ucs2},
{ 147, ucs2, ucs2_sinhala_ci, 2, 2, , mysqlnd_mbcharlen_ucs2, 
check_mb_ucs2},
+   { 149, ucs2, ucs2_croatian_ci, 2, 2, , mysqlnd_mbcharlen_ucs2, 
check_mb_ucs2}, /* MDB */

{ 192, UTF8_MB3, UTF8_MB3_general_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 193, UTF8_MB3, UTF8_MB3_icelandic_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
@@ -584,6 +585,7 @@
{ 209, UTF8_MB3, UTF8_MB3_esperanto_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 210, UTF8_MB3, UTF8_MB3_hungarian_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
{ 211, UTF8_MB3, UTF8_MB3_sinhala_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid},
+   { 213, UTF8_MB3, UTF8_MB3_croatian_ci, 1, 3, , 
mysqlnd_mbcharlen_utf8mb3, check_mb_utf8mb3_valid}, /*MDB*/

{ 224, UTF8_MB4, UTF8_MB4_unicode_ci, 1, 4, , 
mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 225, UTF8_MB4, UTF8_MB4_icelandic_ci, 1, 4, , 
mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},

-- 
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 branches/PHP_5_3/ext/standard/html.c branches/PHP_5_3/ext/standard/tests/strings/bug53021.phpt trunk/ext/standard/html.c trunk/ext/standard/tests/str

2010-10-08 Thread Gustavo André dos Santos Lopes
cataphract   Fri, 08 Oct 2010 16:19:58 +

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

Log:
- Fixed bug #53021 (In html_entity_decode, failure to convert numeric entities 
with ENT_NOQUOTES and ISO-8859-1).

Bug: http://bugs.php.net/53021 (Verified) html_entity_decode not working with 
CP-1251 (5.2 only) and ISO-8859-1
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/standard/html.c
A   php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug53021.phpt
U   php/php-src/trunk/ext/standard/html.c
A   php/php-src/trunk/ext/standard/tests/strings/bug53021.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-10-08 15:52:18 UTC (rev 304207)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-10-08 16:19:58 UTC (rev 304208)
@@ -25,6 +25,8 @@
 - Fixed possible crash in mssql_fetch_batch(). (Kalle)
 - Fixed inconsistent backlog default value (-1) in FPM on many systems. (fat)

+- Fixed bug #53021 (In html_entity_decode, failure to convert numeric entities
+  with ENT_NOQUOTES and ISO-8859-1) (Gustavo).
 - Fixed bug #52981 (Unicode casing table was out-of-date. Updated with
   UnicodeData-6.0.0d7.txt and included the source of the generator program with
   the distribution) (Gustavo).

Modified: php/php-src/branches/PHP_5_3/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/html.c2010-10-08 15:52:18 UTC 
(rev 304207)
+++ php/php-src/branches/PHP_5_3/ext/standard/html.c2010-10-08 16:19:58 UTC 
(rev 304208)
@@ -1020,7 +1020,12 @@
code = strtol(p + 2, next, 10);
}

-   if (next != NULL  *next == ';') {
+   if (code == 39  !(quote_style  
ENT_HTML_QUOTE_SINGLE) ||
+   code == 24  !(quote_style  
ENT_HTML_QUOTE_DOUBLE)) {
+   invalid_code = 1;
+   }
+
+   if (next != NULL  *next == ';'  
!invalid_code) {
switch (charset) {
case cs_utf_8:
q += 
php_utf32_utf8(q, code);
@@ -1032,11 +1037,7 @@
if ((code = 
0x80  code  0xa0) || code  0xff) {

invalid_code = 1;
} else {
-   if 
(code == 39 || !quote_style) {
-   
invalid_code = 1;
-   } else {
-   
*(q++) = code;
-   }
+   *(q++) 
= code;
}
break;


Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug53021.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug53021.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug53021.phpt   
2010-10-08 16:19:58 UTC (rev 304208)
@@ -0,0 +1,10 @@
+--TEST--
+Bug #53021 (Failure to convert numeric entities with ENT_NOQUOTES and 
ISO-8859-1)
+--FILE--
+?php
+var_dump(unpack(H*,html_entity_decode(#233;, ENT_QUOTES, ISO-8859-1)));
+--EXPECT--
+array(1) {
+  [1]=
+  string(2) e9
+}

Modified: php/php-src/trunk/ext/standard/html.c
===
--- php/php-src/trunk/ext/standard/html.c   2010-10-08 15:52:18 UTC (rev 
304207)
+++ php/php-src/trunk/ext/standard/html.c   2010-10-08 16:19:58 UTC (rev 
304208)
@@ -1020,7 +1020,12 @@
code = strtol(p + 2, next, 10);
}

-   if (next != NULL  *next == ';') {
+   if (code == 39  !(quote_style  
ENT_HTML_QUOTE_SINGLE) ||
+   code == 24  !(quote_style  
ENT_HTML_QUOTE_DOUBLE)) {
+   invalid_code = 1;
+

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/html.c branches/PHP_5_3/ext/standard/tests/strings/bug53021.phpt trunk/ext/standard/html.c trunk/ext/standard/tests/str

2010-10-08 Thread Gustavo André dos Santos Lopes
cataphract   Fri, 08 Oct 2010 17:27:19 +

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

Log:
- Fixed a typo in rev #304208 (24 instead of 34/'').
- Improved the test bug53021.phpt to reflect other fixes in rev #304208.
- Updated NEWS to reflect other fixes in rev #304208.

Bugs: http://bugs.php.net/304208 (error getting bug information)
  http://bugs.php.net/53021 (Closed) html_entity_decode not working with 
CP-1251 (5.2 only) and ISO-8859-1
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/standard/html.c
U   php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug53021.phpt
U   php/php-src/trunk/ext/standard/html.c
U   php/php-src/trunk/ext/standard/tests/strings/bug53021.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2010-10-08 16:19:58 UTC (rev 304208)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-10-08 17:27:19 UTC (rev 304209)
@@ -26,7 +26,10 @@
 - Fixed inconsistent backlog default value (-1) in FPM on many systems. (fat)

 - Fixed bug #53021 (In html_entity_decode, failure to convert numeric entities
-  with ENT_NOQUOTES and ISO-8859-1) (Gustavo).
+  with ENT_NOQUOTES and ISO-8859-1). Fixed and extended the fix of ENT_NOQUOTES
+  in html_entity_decode that had introduced the bug (rev #185591) to other
+  encodings. Additionaly, html_entity_decode() now doesn't decode #34; if
+  ENT_NOQUOTES is given. (Gustavo)
 - Fixed bug #52981 (Unicode casing table was out-of-date. Updated with
   UnicodeData-6.0.0d7.txt and included the source of the generator program with
   the distribution) (Gustavo).

Modified: php/php-src/branches/PHP_5_3/ext/standard/html.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/html.c2010-10-08 16:19:58 UTC 
(rev 304208)
+++ php/php-src/branches/PHP_5_3/ext/standard/html.c2010-10-08 17:27:19 UTC 
(rev 304209)
@@ -1020,8 +1020,8 @@
code = strtol(p + 2, next, 10);
}

-   if (code == 39  !(quote_style  
ENT_HTML_QUOTE_SINGLE) ||
-   code == 24  !(quote_style  
ENT_HTML_QUOTE_DOUBLE)) {
+   if (code == '\''  !(quote_style  
ENT_HTML_QUOTE_SINGLE) ||
+   code == ''  !(quote_style  
ENT_HTML_QUOTE_DOUBLE)) {
invalid_code = 1;
}


Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug53021.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug53021.phpt   
2010-10-08 16:19:58 UTC (rev 304208)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug53021.phpt   
2010-10-08 17:27:19 UTC (rev 304209)
@@ -3,8 +3,32 @@
 --FILE--
 ?php
 var_dump(unpack(H*,html_entity_decode(#233;, ENT_QUOTES, ISO-8859-1)));
+echo double quotes variations:, \n;
+echo html_entity_decode(quot;, ENT_NOQUOTES, 'UTF-8'), \n;
+echo html_entity_decode(#34;, ENT_NOQUOTES, 'UTF-8'), \n;
+echo html_entity_decode(quot;, ENT_QUOTES, 'UTF-8'), \n;
+echo html_entity_decode(#34;, ENT_QUOTES, 'UTF-8'), \n;
+echo html_entity_decode(quot;, ENT_COMPAT, 'UTF-8'), \n;
+echo html_entity_decode(#34;, ENT_COMPAT, 'UTF-8'), \n;
+
+echo \nsingle quotes variations:, \n;
+echo html_entity_decode(#39;, ENT_NOQUOTES, 'UTF-8'), \n;
+echo html_entity_decode(#39;, ENT_QUOTES, 'UTF-8'), \n;
+echo html_entity_decode(#39;, ENT_COMPAT, 'UTF-8'), \n;
 --EXPECT--
 array(1) {
   [1]=
   string(2) e9
 }
+double quotes variations:
+quot;
+#34;
+
+
+
+
+
+single quotes variations:
+#39;
+'
+#39;

Modified: php/php-src/trunk/ext/standard/html.c
===
--- php/php-src/trunk/ext/standard/html.c   2010-10-08 16:19:58 UTC (rev 
304208)
+++ php/php-src/trunk/ext/standard/html.c   2010-10-08 17:27:19 UTC (rev 
304209)
@@ -1020,8 +1020,8 @@
code = strtol(p + 2, next, 10);
}

-   if (code == 39  !(quote_style  
ENT_HTML_QUOTE_SINGLE) ||
-   code == 24  !(quote_style  
ENT_HTML_QUOTE_DOUBLE)) {
+   if (code == '\''  !(quote_style  
ENT_HTML_QUOTE_SINGLE) ||
+   code == ''  !(quote_style  
ENT_HTML_QUOTE_DOUBLE)) {
invalid_code = 1;
}


Modified: php/php-src/trunk/ext/standard/tests/strings/bug53021.phpt

[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ dns.c dns_win32.c

2010-10-08 Thread Gustavo André dos Santos Lopes
cataphract   Fri, 08 Oct 2010 23:02:37 +

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

Log:
- Added numeric record type and raw data for unknown DNS
  record types.

Changed paths:
U   php/php-src/trunk/ext/standard/dns.c
U   php/php-src/trunk/ext/standard/dns_win32.c

Modified: php/php-src/trunk/ext/standard/dns.c
===
--- php/php-src/trunk/ext/standard/dns.c2010-10-08 18:30:10 UTC (rev 
304211)
+++ php/php-src/trunk/ext/standard/dns.c2010-10-08 23:02:37 UTC (rev 
304212)
@@ -679,7 +679,15 @@
add_assoc_string(*subarray, replacement, name, 1);
break;
default:
-   cp += dlen;
+   {
+   char buf[10]; /* max length of short + 
sizeof(id #) */
+   snprintf(buf, 10, id #%hu, type);
+   buf[10-1] = '\0';
+   add_assoc_string(*subarray, type, buf, 1);
+   add_assoc_stringl(*subarray, data, (char*) 
cp, (uint) dlen, 1);
+   cp += dlen;
+   break;
+   }
}

add_assoc_string(*subarray, class, IN, 1);

Modified: php/php-src/trunk/ext/standard/dns_win32.c
===
--- php/php-src/trunk/ext/standard/dns_win32.c  2010-10-08 18:30:10 UTC (rev 
304211)
+++ php/php-src/trunk/ext/standard/dns_win32.c  2010-10-08 23:02:37 UTC (rev 
304212)
@@ -320,7 +320,14 @@
break;

default:
-   break;
+   {
+   char buf[10]; /* max length of short + 
sizeof(id #) */
+   snprintf(buf, 10, id #%hu, (unsigned short) 
type);
+   buf[10-1] = '\0';
+   add_assoc_string(*subarray, type, buf, 1);
+   add_assoc_stringl(*subarray, data, (char*) 
pRec-Data, (uint) pRec-wDataLength, 1);
+   break;
+   }
}

add_assoc_string(*subarray, class, IN, 1);

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