3 ms·
Eeeeeeewwwww. If you're using .split() to "parse" untrusted input, and not even validating it against a regex first, that's an epic fail in its own right.
by dfranke 17y ago
Eeeeeeewwwww.
If you're using .split() to "parse" untrusted input, and not even validating it against a regex first, that's an epic fail in its own right.
- tptacek 17y agoWhat a weird thing to say. You trust a regex engine more than you trust "split()"?
- dfranke 17y agoI trust a generated parser more than a hand-written one. Any parsing algorithm that involves the use of split() is almost certain to be weakly thought-out and have ill-defined behavior for unexpected input. A well-written parser will never read past the first unexpected character, or at least token.