mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
Fix htmlspecialchars problem.
This commit is contained in:
parent
cae9763d0a
commit
9e7da02d3b
1 changed files with 3 additions and 2 deletions
|
@ -317,6 +317,7 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
|
||||||
int i, maxlen, len;
|
int i, maxlen, len;
|
||||||
char *new;
|
char *new;
|
||||||
enum entity_charset charset = determine_charset(hint_charset);
|
enum entity_charset charset = determine_charset(hint_charset);
|
||||||
|
int matches_map;
|
||||||
|
|
||||||
maxlen = 2 * oldlen;
|
maxlen = 2 * oldlen;
|
||||||
if (maxlen < 128)
|
if (maxlen < 128)
|
||||||
|
@ -329,7 +330,8 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
|
||||||
int mbseqlen;
|
int mbseqlen;
|
||||||
unsigned char mbsequence[16]; /* allow up to 15 characters in a multibyte sequence */
|
unsigned char mbsequence[16]; /* allow up to 15 characters in a multibyte sequence */
|
||||||
unsigned short this_char = get_next_char(charset, old, &i, mbsequence, &mbseqlen);
|
unsigned short this_char = get_next_char(charset, old, &i, mbsequence, &mbseqlen);
|
||||||
int matches_map;
|
|
||||||
|
matches_map = 0;
|
||||||
|
|
||||||
if (len + 9 > maxlen)
|
if (len + 9 > maxlen)
|
||||||
new = erealloc (new, maxlen += 128);
|
new = erealloc (new, maxlen += 128);
|
||||||
|
@ -339,7 +341,6 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
|
||||||
int j;
|
int j;
|
||||||
unsigned char * rep;
|
unsigned char * rep;
|
||||||
|
|
||||||
matches_map = 0;
|
|
||||||
|
|
||||||
for (j=0; entity_map[j].charset != cs_terminator; j++) {
|
for (j=0; entity_map[j].charset != cs_terminator; j++) {
|
||||||
if (entity_map[j].charset == charset
|
if (entity_map[j].charset == charset
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue