iliaa           Fri Sep 20 07:48:48 2002 EDT

  Modified files:              
    /php4/ext/standard  string.c 
  Log:
  Fixed bugs #12989 and #12120
  
  
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.294 php4/ext/standard/string.c:1.295
--- php4/ext/standard/string.c:1.294    Wed Sep 18 03:55:30 2002
+++ php4/ext/standard/string.c  Fri Sep 20 07:48:47 2002
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.294 2002/09/18 07:55:30 hholzgra Exp $ */
+/* $Id: string.c,v 1.295 2002/09/20 11:48:47 iliaa Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -3324,7 +3324,7 @@
 PHPAPI void php_strip_tags(char *rbuf, int len, int *stateptr, char *allow, int 
allow_len)
 {
        char *tbuf, *buf, *p, *tp, *rp, c, lc;
-       int br, i=0;
+       int br, i=0, depth=0;
        int state = 0;
 
        if (stateptr)
@@ -3353,6 +3353,8 @@
                                        if(allow) {
                                                *(tp++) = '<';
                                        }
+                               } else if (state) {
+                                       depth++;
                                }
                                break;
 
@@ -3383,6 +3385,11 @@
                                break;  
 
                        case '>':
+                               if (depth) {
+                                       depth--;
+                                       break;
+                               }
+                       
                                if (state == 1) {
                                        lc = '>';
                                        state = 0;



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

Reply via email to