好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

有用的javascript防注入漏洞过滤函数 - 网站安全

  <script LANGUAGE=" Java Script"> function check(inputStr) {         if (typeof(inputStr) != "string") {                 return inputStr;         }         var tmpValue = inputStr; // www.2cto.com 以下搜索字符串中的特殊字符,如果存在,则替换成""         while (tmpValue.indexOf(';') > -1) {                 tmpValue = tmpValue.replace(';','');         }         while (tmpValue.indexOf('<') > -1) {                 tmpValue = tmpValue.replace('<','');         }         while (tmpValue.indexOf('>') > -1) {                 tmpValue = tmpValue.replace('>','');         }         while (tmpValue.indexOf('--') > -1) {             tmpValue = tmpValue.replace('--','');         }         while (tmpValue.indexOf(",") > -1) {             tmpValue = tmpValue.replace(",","");         }         while (tmpValue.indexOf("'") > -1) {             tmpValue = tmpValue.replace("'","");         }         while (tmpValue.indexOf("?") > -1) {             tmpValue = tmpValue.replace("?","");         }         document.getElementById("txt1").value = tmpValue;         //重新显示更改后的变量 } </script>

查看更多关于有用的javascript防注入漏洞过滤函数 - 网站安全的详细内容...

  阅读:39次