moriyoshi               Thu Oct  2 15:23:01 2003 EDT

  Modified files:              
    /php-src/ext/standard       html.c 
  Log:
  Fix for the fix for #25707
  
  
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.89 php-src/ext/standard/html.c:1.90
--- php-src/ext/standard/html.c:1.89    Thu Oct  2 15:07:59 2003
+++ php-src/ext/standard/html.c Thu Oct  2 15:23:00 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: html.c,v 1.89 2003/10/02 19:07:59 moriyoshi Exp $ */
+/* $Id: html.c,v 1.90 2003/10/02 19:23:00 moriyoshi Exp $ */
 
 /*
  * HTML entity resources:
@@ -1076,18 +1076,26 @@
                if (!matches_map) {     
                        int is_basic = 0;
 
-                       for (j = 0; basic_entities[j].charcode != 0; j++) {
-                               if ((basic_entities[j].charcode != this_char) ||
-                                       (basic_entities[j].flags && (quote_style & 
basic_entities[j].flags) == 0))
-                                       continue;
-
-                               memcpy(replaced + len, basic_entities[j].entity, 
basic_entities[j].entitylen);
-                               len += basic_entities[j].entitylen;
-                               
+                       if (this_char == '&') {
+                               memcpy(replaced + len, "&", sizeof("&") - 1);
+                               len += sizeof("&") - 1;
                                is_basic = 1;
-                               break;
+                       } else {
+                               for (j = 0; basic_entities[j].charcode != 0; j++) {
+                                       if ((basic_entities[j].charcode != this_char) 
||
+                                                       (basic_entities[j].flags &&
+                                                       (quote_style & 
basic_entities[j].flags) == 0)) {
+                                               continue;
+                                       }
 
+                                       memcpy(replaced + len, 
basic_entities[j].entity, basic_entities[j].entitylen);
+                                       len += basic_entities[j].entitylen;
+               
+                                       is_basic = 1;
+                                       break;
+                               }
                        }
+
                        if (!is_basic) {
                                /* a wide char without a named entity; pass through 
the original sequence */
                                if (mbseqlen > 1) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to