<%
functionhtmlencode (byvalstrvalue)
'忽略错误
onerrorresumenext
'定义变量
DimstrNewValue
ifstrvalue <> ""그런 다음
strnewvalue = replace (strvalue, "<", "<")
strnewvalue = replace (strnewvalue, ">", ">")
strnewvalue = replace (strnewvalue, " '", "" ")
strnewvalue = replace (strnewvalue, "" "," ")
strnewvalue = replace (strnewvalue, vbcrlf, "<br>")
strnewvalue = replace (strnewvalue, "", "")
endif
htmlencode = strnewvalue
'输出错误
iferr.number> 0then
응답 .writeerr.description
응답. 엔드
endif
최종 기능 장애
functionubbcode (strvalue)
dimregexp
'strvalue = htmlencode (strvalue)
setRegexp = NewRegexp
regexp.ignorecase = true
regexp.global = true
ifstrvalue <> ""그런 다음
regexp.pattern = "(/[img/])(. 1)*) (/ 9// img/])" ""
strvalue = regexp.replace (strvalue, "<ahref ="$ 2 ""target = _blank> <imgsrc = ""$ 2 ""border = 0alt = 按此在新窗口浏览图片 onload = ""javascript : if (this.width> screen.width-333) this.width = screen.width-33 ""> </a> ")).
regexp.pattern = "(/[flash/])(. 1)*) (/ 9//Flash/]") "" ""
strvalue = regexp.replace (strvalue, "<objectcodebase =" "http://download.macromedia.com/pub/sho ... h/swflash.cab#버전 = 4,0,2,0 ""classId = clsid : d27cdb6e-ae6d-11cf-96b8-44453540000width = 500height = 400id = shockw aveflash1> <paramname = movieValue = ""$ 2 ""> <paramname = QualityValue = High> <embedsrc = ""$ 2 ""Quality = HighPluginsPage = "" ") 'target = _blank rel = nofollow> http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash" "type ="Appl ... 00Height = 400> </ext> </object> ")
regexp.pattern = "(/[zip/])(. 1)*) (/ 9// Zip/]" "" "
strvalue = regexp.replace (strvalue, "<br> <ahref =" "$ 2" "> </a>")
regexp.pattern = "(/[rar/])(. 1)*) (/ 9// rar/])" "" ""
strvalue = regexp.replace (strvalue, "<br> <ahref =" "$ 2" "> </a>")
'regexp.pattern = "(/[upload = (. [^/[]*)/]) (. [^/[]*) (/[// upload/])" "
'strvalue = regexp.replace (strvalue, "<br> <imgsrc =" "$ 2.gif" "border = 0> <ahref =" "$ 3" "target = _blank> </a>").
'strvalue = regexp.replace (strvalue, "<br> <imgsrc =" "$ 2.gif" "border = 0> 此主题相关图片如下 : <br> <ahref =" "$ 3" "target = _blank> <imgsrc = ""$ 3 ""Border = 0Alt = 按此在新窗口浏览图片 onload = ""JavaScript : if (this.width> screen.width-333) this.width = screen.width-333 ""> </a> ")