The regular expression (that I wrote) on line 230 was too greedy.
If the U modifier is used then this is ungreedy by default.
The problem is when you have the question mark behind a quantifier then it will inverse that quantifier's greediness.
So it will search for an iframe open tag, then search for the last iframe close tag (rather than the next iframe close tag).
\ ORIGINAL REGEXP *
|<iframe\s+.?|siU
By removing the question mark, the whole expression is not greedy by default, resulting in functionality just like you'd want.
\ FIXED REGEXP *
|<iframe\s+.|siU
The regular expression (that I wrote) on line 230 was too greedy. If the U modifier is used then this is ungreedy by default. The problem is when you have the question mark behind a quantifier then it will inverse that quantifier's greediness. So it will search for an iframe open tag, then search for the last iframe close tag (rather than the next iframe close tag). \ ORIGINAL REGEXP * |<iframe\s+.?|siU
By removing the question mark, the whole expression is not greedy by default, resulting in functionality just like you'd want. \ FIXED REGEXP * |<iframe\s+.|siU