]> granicus.if.org Git - php/commitdiff
htmlspecialchars and htmlentities will now
authorHartmut Holzgraefe <hholzgra@php.net>
Tue, 25 Jul 2000 10:18:06 +0000 (10:18 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Tue, 25 Jul 2000 10:18:06 +0000 (10:18 +0000)
encode single quotes to &#39;
(due to feature request in BUG ID#5254)

ext/standard/html.c

index 9c7a8e9fad8624b7cddc343880752f9c1ba2ac81..2b9dd2ccca525624a80a3719b6f2e3d75279dcd1 100644 (file)
@@ -66,6 +66,10 @@ PHPAPI char *php_escape_html_entities(unsigned char *old, int oldlen, int *newle
                } else if (34 == *old) {
                        memcpy (new + len, "&quot;", 6);
                        len += 6;
+               } else if (39 == *old) {
+                       /* single quote (') */
+                       memcpy (new + len, "&#039;",6);
+                       len += 6;               
                } else if (60 == *old) {
                        memcpy (new + len, "&lt;", 4);
                        len += 4;