3 ms·
I feel kind of uncomfortable with that regular expression for scrubbing data. It seems to be fail-open rather than fail-close and does clearly not cover the ful
by jsnell 10y ago
I feel kind of uncomfortable with that regular expression for scrubbing data. It seems to be fail-open rather than fail-close and does clearly not cover the full lexical structure (e.g. hex numbers or MySQL's disgusting hex-encoded strings, including the numeric digits, are not caught by any of those cases, and thus would leak in ful. Or there's the possibility of string escaping with backslashes being turned off with a config setting, which would screw up the escape handling in the regular expression).
Am I missing some subtlety that makes it safe?
- placrosse 10y agoI have no doubt that there are some cases which won't match. This particular utility does not need to be 100% on for every possible corner case, to produce the desired result. That said, all improvements, whether pull request or posted suggestions, are much appreciated. My comments regarding the regex was the very high number of cases that are correctly handled, with such a small amount of code. Thank you for your comments. I appreciate it.