diff --git a/ext/standard/string.c b/ext/standard/string.c index 2daac404af9..52274dc2481 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2768,7 +2768,7 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allo lc = '('; br++; } - } else if (state == 1) { + } else if (allow && state == 1) { *(tp++) = c; } else if (state == 0) { *(rp++) = c; @@ -2781,7 +2781,7 @@ PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allo lc = ')'; br--; } - } else if (state == 1) { + } else if (allow && state == 1) { *(tp++) = c; } else if (state == 0) { *(rp++) = c;