国产成人精品18p,天天干成人网,无码专区狠狠躁天天躁,美女脱精光隐私扒开免费观看

asp中實(shí)現清除html的函數

發(fā)布時(shí)間:2021-08-17 12:10 來(lái)源: 閱讀:0 作者: 欄目: ASP 歡迎投稿:712375056

這個(gè)函數是必需要的,很多黑客來(lái)?yè)v亂,黑掉數據,會(huì )注入大量的病毒js,在存儲和展示文本數據的時(shí)候,使用此函數過(guò)濾一下,可避免不少麻煩

clearhtml代碼

'清除HTML代碼
function clearhtml(content)
  content=replacehtml("&#[^>]*;","",content)
  content=replacehtml("</?marquee[^>]*>","",content)
  content=replacehtml("</?object[^>]*>","",content)
  content=replacehtml("</?param[^>]*>","",content)
  content=replacehtml("</?embed[^>]*>","",content)
  content=replacehtml("</?table[^>]*>","",content)
  content=replacehtml("&nbsp;","",content)
  content=replacehtml("</?tr[^>]*>","",content)
  content=replacehtml("</?th[^>]*>","",content)
  content=replacehtml("</?p[^>]*>","",content)
  content=replacehtml("</?a[^>]*>","",content)
  content=replacehtml("</?img[^>]*>","",content)
  content=replacehtml("</?tbody[^>]*>","",content)
  content=replacehtml("</?li[^>]*>","",content)
  content=replacehtml("</?span[^>]*>","",content)
  content=replacehtml("</?div[^>]*>","",content)
  content=replacehtml("</?th[^>]*>","",content)
  content=replacehtml("</?td[^>]*>","",content)
  content=replacehtml("</?script[^>]*>","",content)
  content=replacehtml("(javascript|jscript|vbscript|vbs):","",content)
  content=replacehtml("on(mouse|exit|error|click|key)","",content)
  content=replacehtml("<\\?xml[^>]*>","",content)
  content=replacehtml("<\/?[a-z]+:[^>]*>","",content)
  content=replacehtml("</?font[^>]*>","",content)
  content=replacehtml("</?h[^>]*>","",content)
  content=replacehtml("</?u[^>]*>","",content)
  content=replacehtml("</?i[^>]*>","",content)
  content=replacehtml("</?center[^>]*>","",content)
  content=replacehtml("</?center[^>]*>","",content)
  content=replacehtml("</?nobr[^>]*>","",content)
  content=replacehtml("</?clk[^>]*>","",content)
  content=replacehtml("</?muti[^>]*>","",content)
  content=replacehtml("</?/option[^>]*>","",content)
  content=replacehtml("</?o[^>]*>","",content)
  content=replacehtml("</?strong[^>]*>","",content)
  clearhtml=content
end function

replacehtml代碼

function replacehtml(patrn,strng,content)  
  if isnull(content) then
    content=""
  end if
  set regex=new regexp
  regex.pattern=patrn
  regex.ignorecase=true
  regex.global=true
  replacehtml=regex.replace(content,strng)
end function

使用方法:

代碼如下:
<%=clearhtml("<div id="CodeTip"><h2>分享代碼提示(2)</h2><ul><li style="font-weight: bold; color: rgb(170, 0, 0);">添加完代碼必須點(diǎn)擊“完成并查看”生效</li><li>準確的編程語(yǔ)言,可正確對代碼語(yǔ)法著(zhù)色</li><li>輸入簡(jiǎn)單幾個(gè)字的代碼片段說(shuō)明</li><li>上傳源碼文件時(shí)無(wú)需再輸入說(shuō)明</li><li>非程序相關(guān)文件將直接刪除,嚴重封帳號</li><li>圖片僅用來(lái)上傳截圖之類(lèi)的文件,勿作他途</li></ul></div>")%>

以上就是本文所述的全部?jì)热萘?,希望大家能夠喜歡。

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng )、來(lái)自本網(wǎng)站內容采集于網(wǎng)絡(luò )互聯(lián)網(wǎng)轉載等其它媒體和分享為主,內容觀(guān)點(diǎn)不代表本網(wǎng)站立場(chǎng),如侵犯了原作者的版權,請告知一經(jīng)查實(shí),將立刻刪除涉嫌侵權內容,聯(lián)系我們QQ:712375056,同時(shí)歡迎投稿傳遞力量。

亚洲AV无码AV男人的天堂不卡| 伊人久久亚洲综合影院首页| 一性一交一口添一摸视频| 日韩人妻无码精品一专区| 国产精品鲁鲁鲁| 一边摸一边桶一边脱免费|