paul
07/08/2024, 9:00 AM<cfif ReFindNoCase("^[a-z0-9_:./-]+$", arguments.value)><cfreturn 0></cfif>
and I think if I change it to
<cfif ReFindNoCase("^[a-z0-9_:./-##]+$", arguments.value)><cfreturn 0></cfif>
( SQLInjectionFilter.ccfc ) It should be OK. This is a legacy code base so it's hard to find exact tests. Yes I know Pete write it and have also reached out just want top see if anyone could help sooner.brettpr
07/08/2024, 9:13 AMpaul
07/08/2024, 9:15 AMaliaspooryorik
aliaspooryorik
rodyon
07/08/2024, 9:32 AMrodyon
07/08/2024, 9:32 AMrodyon
07/08/2024, 9:33 AMaliaspooryorik
##
should work, depends where you put in though. If you put it after a control character you'll get a malformed expression. For example -
is for character ranges. So yeah, in that example it'll get confused and thing you are doing a character range.rodyon
07/08/2024, 9:34 AMaliaspooryorik
"^[a-z0-9##_:./-]+$"
is more readablealiaspooryorik
paul
07/08/2024, 10:11 AM"^[a-z0-9##_:./-]+$".
paul
07/08/2024, 10:11 AMpaul
07/08/2024, 10:14 AMaliaspooryorik
^
- it is confusing as has two meanings depending on context. If you use the ^
at the start of a reg exp, then it acts as an anchor, if you use it inside a set then it acts as a not presentaliaspooryorik
^[^a-z]+$
the first ^
refers to the start of the string (an anchor). The second ^
is in a set so means "non of these characters"aliaspooryorik
^[a-z0-9_:./-]+$
it's doing ^
and $
to make sure it matches the whole string