moriyoshi               Mon Jul 19 13:46:30 2004 EDT

  Added files:                 
    /php-src/ext/standard/tests/strings bug29199.phpt 

  Modified files:              
    /php-src/ext/standard       html.c 
  Log:
  - Fix bug #29199 (html_entity_decode() misbehaves with UTF-8)
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/html.c?r1=1.97&r2=1.98&ty=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.97 php-src/ext/standard/html.c:1.98
--- php-src/ext/standard/html.c:1.97    Tue Jul 13 13:14:49 2004
+++ php-src/ext/standard/html.c Mon Jul 19 13:46:30 2004
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: html.c,v 1.97 2004/07/13 17:14:49 wez Exp $ */
+/* $Id: html.c,v 1.98 2004/07/19 17:46:30 moriyoshi Exp $ */
 
 /*
  * HTML entity resources:
@@ -157,11 +157,13 @@
        "ensp", "emsp", NULL, NULL, NULL, NULL, NULL,
        "thinsp", NULL, NULL, "zwnj", "zwj", "lrm", "rlm",
        NULL, NULL, NULL, "ndash", "mdash", NULL, NULL, NULL,
-       "lsquo", "rsquo", "sbquo", NULL, "ldquo", "rdquo", "bdquo",
+       /* 8216 */
+       "lsquo", "rsquo", "sbquo", NULL, "ldquo", "rdquo", "bdquo", NULL,
        "dagger", "Dagger",     "bull", NULL, NULL, NULL, "hellip",
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "permil", NULL,
-       "prime", "Prime", NULL, NULL, NULL, NULL, NULL, "lsaquo", "rsaquo",
-       NULL, NULL, NULL, "oline", NULL, NULL, NULL, NULL, NULL,
+       /* 8242 */
+       "prime", "Prime", NULL, NULL, NULL, NULL, NULL, "lsaquo", "rsaquo", NULL,
+       NULL, NULL, "oline", NULL, NULL, NULL, NULL, NULL,
        "frasl"
 };
 
@@ -899,8 +901,7 @@
 
                                if (entity_map[j].table[k - entity_map[j].basechar] == 
NULL)
                                        continue;
-                       
-                               
+
                                entity[0] = '&';
                                entity_length = strlen(entity_map[j].table[k - 
entity_map[j].basechar]);
                                strncpy(&entity[1], entity_map[j].table[k - 
entity_map[j].basechar], sizeof(entity) - 2);

http://cvs.php.net/co.php/php-src/ext/standard/tests/strings/bug29199.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/strings/bug29199.phpt
+++ php-src/ext/standard/tests/strings/bug29199.phpt
--TEST--
Bug #29199 (html_entity_decode() misbehaves with UTF-8)
--FILE--
<?php
var_dump(bin2hex(html_entity_decode('&ensp;&thinsp;&lsquo;&dagger;&prime;&frasl;&euro;',
 ENT_QUOTES, 'UTF-8')));
?>
--EXPECT--
string(42) "e28082e28089e28098e280a0e280b2e28184e282ac"

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

Reply via email to