I have found a bug in the strip_enclosed_content implementation. When deleting tags from the stripper stack in _delete_tag_from_stack(), it is assumed that the HTML within those tags is valid. However, if the HTML is broken, then the stack will not be cleared between calls to process(). Not only will this result in the $hr object becoming useless, but for every call to $hr->process the stripper stack will grow continuously, like this:
I have found a bug in the strip_enclosed_content implementation. When deleting tags from the stripper stack in _delete_tag_from_stack(), it is assumed that the HTML within those tags is valid. However, if the HTML is broken, then the stack will not be cleared between calls to process(). Not only will this result in the $hr object becoming useless, but for every call to $hr->process the stripper stack will grow continuously, like this:
["script"] ["script", "script"] ["script", "script", "script"] ["script", "script", "script", "script"] ["script", "script", "script", "script", "script"] ["script", "script", "script", "script", "script", "script"]
As a test case, try this: