htmlpurifier
htmlpurifier copied to clipboard
Unreachable switch case in PH5P lexer
https://github.com/ezyang/htmlpurifier/blob/master/library/HTMLPurifier/Lexer/PH5P.php#L1877-L1912
In the switch statement in mainPhase(), both IN_BODY and END_PHASE are cases.
self::IN_BODY is 3.
self::END_PHASE is also 3. Because self::IN_BODY is first, it is checked first, so the code in case self::END_PHASE is unreachable.
This was detected via static analysis (and the only issue of its type in this project) - I'm not sure what the impact is. Maybe the latter one shouldn't be there, but I'm not sure (I don't see the other PHASE constants)