3 ms·
and if you were determined to use a regex, wouldn't you create a whitelist pattern (i.e. just numbers) rather than a blacklist (no quotes, whitespace, etc)?
by eli 17y ago
and if you were determined to use a regex, wouldn't you create a whitelist pattern (i.e. just numbers) rather than a blacklist (no quotes, whitespace, etc)?
- tptacek 17y agoYes. Better yet: if your parameter is numeric (say, a LIMIT), typecast it to an integer (to_i, int(), etc).