Strip-slashes em ASP , como usar este código para proteção.
-
Olá meu amigos tenho esse código em asp , porém não sei como usá-lo, como faço para proteger minhas páginas contra CSFR ,
-
como faço para usá-lo na página de login que contem formulário,to começando agora e não tenho a menor ideia.
Agradeço desde já a ajuda de vcs.
<%
' Copyright © 2009, reusablecode.blogspot.com; some rights reserved.
'
' This work is licensed under the Creative Commons Attribution License. To view
' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
' 94305, USA.
' Despite the identical naming, these functions are more comprehensive than their PHP equivalents.
' They go above and beyond even mysql_real_escape_string(), by including support for backspace and horizontal tab.
' List of characters handled:
' \000 null
' \010 backspace
' \011 horizontal tab
' \012 new line
' \015 carriage return
' \032 substitute
' \042 double quote
' \047 single quote
' \134 backslash
' \140 grave accent
' Returns a string with backslashes before characters that need to be quoted in database queries
function addslashes(unsafeString)
dim regEx
set regEx = new RegExp
with regEx
.Global = true
.IgnoreCase = true
.Pattern = "([\000\010\011\012\015\032\042\047\134\140])"
end with
addslashes = regEx.replace(unsafeString, "\$1")
set regEx = nothing
end function
' Un-quote string quoted with addslashes()
function stripslashes(safeString)
dim regEx
set regEx = new RegExp
with regEx
.Global = true
.IgnoreCase = true
.Pattern = "\\([\000\010\011\012\015\032\042\047\134\140])"
end with
stripslashes = regEx.replace(safeString, "$1")
set regEx = nothing
end function
%>
Discussão (1)
Carregando comentários...