rasmus          Tue Dec 31 10:18:53 2002 EDT

  Modified files:              
    /php4/ext/standard  string.c 
  Log:
  Fix for bug #21311
  
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.338 php4/ext/standard/string.c:1.339
--- php4/ext/standard/string.c:1.338    Thu Dec 26 15:52:42 2002
+++ php4/ext/standard/string.c  Tue Dec 31 10:18:52 2002
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.338 2002/12/26 20:52:42 sterling Exp $ */
+/* $Id: string.c,v 1.339 2002/12/31 15:18:52 rasmus Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -3509,11 +3509,12 @@
                                /* JavaScript & Other HTML scripting languages */
                                if (state == 1 && *(p-1) == '<') { 
                                        state = 3;
+                                       lc = c;
                                } else {
                                        *(rp++) = c;
                                }       
                                break;
-                       
+
                        case '?':
 
                                if (state == 1 && *(p-1)=='<') { 
@@ -3522,13 +3523,28 @@
                                        break;
                                }
 
+                       case 'E':
+                       case 'e':
+                               /* !DOCTYPE exception */
+                               if (state==3 && p > buf+6
+                                                    && tolower(*(p-1)) == 'p'
+                                                && tolower(*(p-2)) == 'y'
+                                                    && tolower(*(p-3)) == 't'
+                                                    && tolower(*(p-4)) == 'c'
+                                                    && tolower(*(p-5)) == 'o'
+                                                    && tolower(*(p-6)) == 'd') {
+                                       state = 1;
+                                       break;
+                               }
+                               /* fall-through */
+
                        case 'l':
 
                                /* swm: If we encounter '<?xml' then we shouldn't be in
                                 * state == 2 (PHP). Switch back to HTML.
                                 */
 
-                               if (state == 2 && *(p-1) == 'm' && *(p-2) == 'x') {
+                               if (state == 2 && p > buf+2 && *(p-1) == 'm' && *(p-2) 
+== 'x') {
                                        state = 1;
                                        break;
                                }



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

Reply via email to