asp SQL 주입 빈틈 방지

1179 단어
SQL 주입의 빈틈을 막아낼 수 있는 함수 4개를 제시합니다!코드를 읽으면 너는 융통할 수 있다.
모든 Request 대상을 필터해야 합니다: Request를 포함합니다.cookie, request.ServerVariables와 같이 무시되기 쉬운 객체:
 
  
function killn(byval s1) '
if not isnumeric(s1) then
killn=0
else
if s1<0 or s1>2147483647 then
killn=0
else
killn=clng(s1)
end if
end if
end function

function killc(byval s1)
if not isnumeric(s1) then
killc=0
else
killc=formatnumber(s1,2,-1,0,0)
end if
end function

function killw(byval s1) '
if len(s1)=0 then
killw=""
else
killw=trim(replace(s1,"'",""))
end if
end function

function killbad(byval s1) ,
If len(s1) = 0 then
killbad=""
else
killbad = trim(replace(replace(replace(replace(replace(replace(replace(replace(s1,Chr(10), "
"), Chr(34), """), ">", ">"), "end if
end function

좋은 웹페이지 즐겨찾기