htmlpurifier icon indicating copy to clipboard operation
htmlpurifier copied to clipboard

Unreachable switch case in PH5P lexer

Open TysonAndre opened this issue 7 years ago • 0 comments

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)

TysonAndre avatar Jan 30 '19 02:01 TysonAndre