From 71a5313fc58aeee90afcd26e9931a7581609810c Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 3 Jan 2003 12:31:13 +0000 Subject: [PATCH] - MFH for bug #21311 --- ext/standard/string.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 69f1e89e96..b37e2697bc 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1399,6 +1399,9 @@ PHP_FUNCTION(strstr) if (Z_TYPE_PP(needle) == IS_STRING) { if (!Z_STRLEN_PP(needle)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty delimiter."); + efree(haystack_orig); + zval_ptr_dtor(haystack); + zval_ptr_dtor(needle); RETURN_FALSE; } @@ -3509,11 +3512,12 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int *stateptr, char *allow, int /* 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 +3526,28 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int *stateptr, char *allow, int 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 ' buf+2 && *(p-1) == 'm' && *(p-2) == 'x') { state = 1; break; } -- 2.50.1