]> granicus.if.org Git - php/commitdiff
fix the new 'no-double-encoding' feature of htmlspecialchars() (the length for char...
authorNuno Lopes <nlopess@php.net>
Sun, 27 May 2007 15:45:18 +0000 (15:45 +0000)
committerNuno Lopes <nlopess@php.net>
Sun, 27 May 2007 15:45:18 +0000 (15:45 +0000)
ext/standard/html.c

index 9d73ce216c042e7b13ce5e27f0e43c4f0de956d1..a5f5292c3325c9802569e97e6787d4c96f6de138 100644 (file)
@@ -1153,7 +1153,7 @@ encode_amp:
                                        memcpy(replaced + len, "&amp;", sizeof("&amp;") - 1);
                                        len += sizeof("&amp;") - 1;
                                } else {
-                                       char *e = memchr(old + i, ';', len - i);
+                                       char *e = memchr(old + i, ';', oldlen - i);
                                        char *s = old + i + 1;
 
                                        if (!e || (e - s) > 10) { /* minor optimization to avoid "entities" over 10 chars in length */