TASTEME deobfuscate, comment, and add non-ascii behavior #604
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An obfuscated meme function called TASTEME() was introduced ~5mo ago with no documentation. It appears to check for 3 sequential characters in a string; however its behavior is irregular for non-ascii strings, and could be dangerous depending on user implementation. For example, if used for hyperlink validation, it would be vulnerable to IDN homograph attacks.
For example:
abcddd
aabbcc
https://www
://
abcçççddd
100700070006c0065
This PR de-obfuscates the code, and uses enumerate() and the == operator to make comparisons. This results in more sane/safe behavior.
Since this function was introduced as a meme, it should probably just be removed. But that's like, just my opinion, man.