]> granicus.if.org Git - php/commitdiff
Fix htmlspecialchars problem.
authorWez Furlong <wez@php.net>
Fri, 24 Aug 2001 08:58:10 +0000 (08:58 +0000)
committerWez Furlong <wez@php.net>
Fri, 24 Aug 2001 08:58:10 +0000 (08:58 +0000)
ext/standard/html.c

index 857ea0ccde8640978e63a26fa4a48c87a69c0e3a..a9681fd1734f9822c3059379384d80c1d1f1ef0f 100644 (file)
@@ -317,6 +317,7 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
        int i, maxlen, len;
        char *new;
        enum entity_charset charset = determine_charset(hint_charset);
+       int matches_map;
 
        maxlen = 2 * oldlen;
        if (maxlen < 128)
@@ -329,7 +330,8 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
                int mbseqlen;
                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);
-               int matches_map;
+                       
+               matches_map = 0;
                
                if (len + 9 > maxlen)
                        new = erealloc (new, maxlen += 128);
@@ -339,7 +341,6 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
                        int j;
                        unsigned char * rep;
        
-                       matches_map = 0;
 
                        for (j=0; entity_map[j].charset != cs_terminator; j++)  {
                                if (entity_map[j].charset == charset