I've flagged this answer as a comment because it talks about the exact code in the accepted answer, but doesn't offer a solution.
My flag was declined based on alleged lack of evidence:
Since I can't get in touch with "a moderator", I'm posting in here in hope the decision is re-evaluated. The evidence is that the code in the answer is the same as the code in the accepted answer, and the answer comments on a problem with that code.