diff options
Diffstat (limited to 'ext/mbstring/libmbfl')
| -rw-r--r-- | ext/mbstring/libmbfl/README | 2 | ||||
| -rw-r--r-- | ext/mbstring/libmbfl/filters/mbfilter_htmlent.c | 52 | ||||
| -rwxr-xr-x | ext/mbstring/libmbfl/filters/mk_sb_tbl.awk | 2 | ||||
| -rw-r--r-- | ext/mbstring/libmbfl/mbfl.rc | 2 | ||||
| -rw-r--r-- | ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk | 2 |
5 files changed, 50 insertions, 10 deletions
diff --git a/ext/mbstring/libmbfl/README b/ext/mbstring/libmbfl/README index 476a589aa..a4a2ef28b 100644 --- a/ext/mbstring/libmbfl/README +++ b/ext/mbstring/libmbfl/README @@ -5,4 +5,4 @@ See LICENSE and DISCLAIMER for licensing information. See the file INSTALL for building and installation instructions. -# $Id: README,v 1.4 2005/02/20 22:18:07 moriyoshi Exp $ +# $Id: README 180252 2005-02-20 22:18:09Z moriyoshi $ diff --git a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c b/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c index 6c6654a1b..0163520f5 100644 --- a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c +++ b/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c @@ -186,18 +186,58 @@ int mbfl_filt_conv_html_dec(int c, mbfl_convert_filter *filter) } } else { if (c == ';') { - buffer[filter->status] = 0; if (buffer[1]=='#') { - /* numeric entity */ - for (pos=2; pos<filter->status; pos++) { - ent = ent*10 + (buffer[pos] - '0'); + if (filter->status > 2 && (buffer[2] == 'x' || buffer[2] == 'X')) { + if (filter->status > 3) { + /* numeric entity */ + for (pos=3; pos<filter->status; pos++) { + int v = buffer[pos]; + if (v >= '0' && v <= '9') { + v = v - '0'; + } else if (v >= 'A' && v <= 'F') { + v = v - 'A' + 10; + } else if (v >= 'a' && v <= 'f') { + v = v - 'a' + 10; + } else { + ent = -1; + break; + } + ent = ent * 16 + v; + } + } else { + ent = -1; + } + } else { + /* numeric entity */ + if (filter->status > 2) { + for (pos=2; pos<filter->status; pos++) { + int v = buffer[pos]; + if (v >= '0' && v <= '9') { + v = v - '0'; + } else { + ent = -1; + break; + } + ent = ent*10 + v; + } + } else { + ent = -1; + } + } + if (ent >= 0 && ent < 0x110000) { + CK((*filter->output_function)(ent, filter->data)); + } else { + for (pos = 0; pos < filter->status; pos++) { + CK((*filter->output_function)(buffer[pos], filter->data)); + } + CK((*filter->output_function)(c, filter->data)); } - CK((*filter->output_function)(ent, filter->data)); filter->status = 0; /*php_error_docref("ref.mbstring" TSRMLS_CC, E_NOTICE, "mbstring decoded '%s'=%d", buffer, ent);*/ } else { /* named entity */ - entity = (mbfl_html_entity_entry *)mbfl_html_entity_list; + buffer[filter->status] = 0; + entity = (mbfl_html_entity_entry *)mbfl_html_entity_list; while (entity->name) { if (!strcmp(buffer+1, entity->name)) { ent = entity->code; diff --git a/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk b/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk index 6d49a9ea7..0faf1cd46 100755 --- a/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk +++ b/ext/mbstring/libmbfl/filters/mk_sb_tbl.awk @@ -1,6 +1,6 @@ #!/usr/bin/awk -f # -# $Id: mk_sb_tbl.awk,v 1.2 2005/02/21 07:57:08 moriyoshi Exp $ +# $Id: mk_sb_tbl.awk 180308 2005-02-21 07:57:08Z moriyoshi $ # # Description: a script that generates a single byte code set to Unicode # mapping table. diff --git a/ext/mbstring/libmbfl/mbfl.rc b/ext/mbstring/libmbfl/mbfl.rc index 0ee7d97da..d885c624d 100644 --- a/ext/mbstring/libmbfl/mbfl.rc +++ b/ext/mbstring/libmbfl/mbfl.rc @@ -1,4 +1,4 @@ -/* $Id: mbfl.rc,v 1.5.6.1 2008/07/05 06:52:04 hirokawa Exp $ */ +/* $Id: mbfl.rc 262042 2008-07-05 06:52:04Z hirokawa $ */ 1 VERSIONINFO FILEVERSION 1,0,2,0 PRODUCTVERSION 1,0,2,0 diff --git a/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk b/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk index c9fdf7c5d..de2b7e0be 100644 --- a/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk +++ b/ext/mbstring/libmbfl/mbfl/mk_eaw_tbl.awk @@ -1,6 +1,6 @@ #!/usr/bin/awk -f # -# $Id: mk_eaw_tbl.awk,v 1.2 2005/02/20 22:18:08 moriyoshi Exp $ +# $Id: mk_eaw_tbl.awk 180252 2005-02-20 22:18:09Z moriyoshi $ # # Description: a script to generate east asian width table. # |
