主题:  我的动网FINAL版发公告时显示错误

番茄蛋汤

职务:普通成员
等级:3
金币:10.0
发贴:807
#12002/10/27 19:15:43
我的论坛是用的ACCESS97的数据库(因为我的空间驱动是ACCESS97的,所以只好用AC97了),发布公告后点击显示:
Microsoft VBScript 运行时错误 错误 '800a005e'

无效使用 Null: 'Replace'

/epochan/bbs/inc/ubbcode.asp, 行382

怎么修改呢?



番茄蛋汤

职务:普通成员
等级:3
金币:10.0
发贴:807
#22002/10/27 19:22:58
代码如下:
<%
function DvBCode(strContent,PostUserGroup)
if Cint(Forum_Setting(35)) <> 1 then
    strContent = dvHTMLEncode(strContent)
else
    strContent = HTMLcode(strContent)
end if
if Cint(Forum_Setting(34))<>1 and PostUserGroup>2 then
    DvBCode=strContent
    exit function
end if
dim re
dim po,ii
dim reContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
po=0
ii=0

re.Pattern="(javascript)"
strContent=re.Replace(strContent,"javascript")
re.Pattern="(jscript:)"
strContent=re.Replace(strContent,"jscript:")
re.Pattern="(js:)"
strContent=re.Replace(strContent,"js:")
re.Pattern="(value)"
strContent=re.Replace(strContent,"value")
re.Pattern="(about:)"
strContent=re.Replace(strContent,"about:")
re.Pattern="(file:)"
strContent=re.Replace(strContent,"file:")
re.Pattern="(documents.cookie)"
strContent=re.Replace(strContent,"documents.cookie")
re.Pattern="(vbscript:)"
strContent=re.Replace(strContent,"vbscript:")
re.Pattern="(vbs:)"
strContent=re.Replace(strContent,"vbs:")
re.Pattern="(on(mouse|exit|error|click|key))"
strContent=re.Replace(strContent,"on$2")
    
if Cint(Forum_Setting(36)) = 1 or PostUserGroup<4 then
    re.Pattern="\[IMG\](http|https|ftp):\/\/(.[^\[]*)\[\/IMG\]"
    strContent=re.Replace(strContent,"按此在新窗口浏览图片screen.width-333)this.width=screen.width-333"">")
    re.Pattern="\[UPLOAD=(gif|jpg|jpeg|bmp|png)\](.[^\[]*)(gif|jpg|jpeg|bmp|png)\[\/UPLOAD\]"
    strContent= re.Replace(strContent,"
此主题相关图片如下:
按此在新窗口浏览图片screen.width-333)this.width=screen.width-333"">")
end if

re.Pattern="\[UPLOAD=(.[^\[]*)\](.[^\[]*)\[\/UPLOAD\]"
strContent= re.Replace(strContent,"
点击浏览该文件")

if cint(Forum_Setting(67))=1 or PostUserGroup<4 then
    re.Pattern="\[DIR=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/DIR]"
    strContent=re.Replace(strContent,"")
    re.Pattern="\[QT=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/QT]"
    strContent=re.Replace(strContent,"")
    re.Pattern="\[MP=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/MP]"
    strContent=re.Replace(strContent,"")
    re.Pattern="\[RM=*([0-9]*),*([0-9]*)\](.[^\[]*)\[\/RM]"
    strContent=re.Replace(strContent,"
")

    re.Pattern="(\[FLASH\])(.[^\[]*)(\[\/FLASH\])"
    strContent= re.Replace(strContent,"点击开新窗口欣赏该FLASH动画![全屏欣赏]
$2")

    re.Pattern="(\[FLASH=*([0-9]*),*([0-9]*)\])(.[^\[]*)(\[\/FLASH\])"
    strContent= re.Replace(strContent,"点击开新窗口欣赏该FLASH动画![全屏欣赏]
$4")
end if

'积分可见
re.Pattern="(^.*)(\[point=*([0-9]*)\])(.[^\[]*)(\[\/point\])(.*)"
po=re.Replace(strContent,"$3")
if IsNumeric(po) then
    ii=int(po)
else
    ii=0
end if
if membername=username or myuserep>ii then
    strContent=re.Replace(strContent,"$1
以下为需要积分达到$3才能浏览的内容
$4
$6")
else
    strContent=re.Replace(strContent,"$1
此内容要求积分达到$3以上才可以浏览
$6")
end if
'魅力可见
re.Pattern="(^.*)(\[UserCP=*([0-9]*)\])(.[^\[]*)(\[\/UserCP\])(.*)"
po=re.Replace(strContent,"$3")
if IsNumeric(po) then
    ii=int(po)
else
    ii=0
end if
if membername=username or myusercp>ii then
    strContent=re.Replace(strContent,"$1
以下为需要魅力达到$3才能浏览的内容
$4
$6")
else
    strContent=re.Replace(strContent,"$1
此内容要求魅力达到$3以上才可以浏览
$6")
end if
'威望可见
re.Pattern="(^.*)(\[Power=*([0-9]*)\])(.[^\[]*)(\[\/Power\])(.*)"
po=re.Replace(strContent,"$3")
if IsNumeric(po) then
    ii=int(po)
else
    ii=0
end if
if membername=username or mypower>ii then
    strContent=re.Replace(strContent,"$1
以下为需要威望达到$3才能浏览的内容
$4
$6")
else
    strContent=re.Replace(strContent,"$1
此内容要求威望达到$3以上才可以浏览
$6")
end if
'文章可见
re.Pattern="(^.*)(\[Post=*([0-9]*)\])(.[^\[]*)(\[\/Post\])(.*)"
po=re.Replace(strContent,"$3")
if IsNumeric(po) then
    ii=int(po)
else
    ii=0
end if
if membername=username or myArticle>ii then
    strContent=re.Replace(strContent,"$1
以下为需要文章数达到$3才能浏览的内容
$4
$6")
else
    strContent=re.Replace(strContent,"$1
此内容要求文章数达到$3以上才可以浏览
$6")
end if
'金钱可见
re.Pattern="(^.*)(\[money=*([0-9]*)\])(.[^\[]*)(\[\/money\])(.*)"
po=re.Replace(strContent,"$3")
if IsNumeric(po) then
    ii=int(po)
else
    ii=0
end if
if membername=username or mymoney>ii then
    strContent=re.Replace(strContent,"$1
以下为需要金钱数达到$3才能浏览的内容
$4
$6")
else
    strContent=re.Replace(strContent,"$1
此内容要求金钱数达到$3以上才可以浏览
$6")
end if
'回复可见
if instr(lcase(strContent),"[replyview]")>0 and instr(lcase(strContent),"[/replyview]")>0 then
    dim vrs
    set vrs=conn.execute("select AnnounceID from "&TotalUseTable&" where rootid="&Announceid&" and PostUserID="&UserID)
    re.Pattern="(\[replyview\])(.[^\[]*)(\[\/replyview\])"
    if vrs.eof and vrs.bof then
    strContent=re.Replace(strContent,"
此内容需要回复才能浏览
")
    else
    strContent=re.Replace(strContent,"
以下内容为需要回复才能浏览
$2
")
    end if
    set vrs=nothing
end if

re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"$2")
re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"$3")

re.Pattern="(\[EMAIL\])(\S+\@.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"$2")
re.Pattern="(\[EMAIL=(\S+\@.[^\[]*)\])(.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"$3")

'自动识别网址
re.Pattern = "^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1")
re.Pattern = "((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
strContent = re.Replace(strContent,"$1")
re.Pattern = "([^>=""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1$2")

'自动识别www等开头的网址
re.Pattern = "([^(http://|http:\\)])((www|cn)[.](\w)+[.]{1,}(net|com|cn|org|cc)(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=](\w)+)*)*)"
strContent = re.Replace(strContent,"$2")

'自动识别Email地址,如打开本功能在浏览内容很多的帖子会引起服务器停顿
're.Pattern = "([^(=)])((\w)+[@]{1}((\w)+[.]){1,3}(\w)+)"
'strContent = re.Replace(strContent,"$2")

if Forum_Setting(37) = "1" or PostUserGroup<4 then
    re.Pattern="\[em(.[^\[]*)\]"
    strContent=re.Replace(strContent,"")
end if

re.Pattern="\[HTML\](.[^\[]*)\[\/HTML\]"
strContent=re.Replace(strContent,"
以下内容为程序代码:
$1
")
re.Pattern="\[code\](.[^\[]*)\[\/code\]"
strContent=re.Replace(strContent,"
以下内容为程序代码:
$1
")

re.Pattern="\[color=(.[^\[]*)\](.[^\[]*)\[\/color\]"
strContent=re.Replace(strContent,"$2")
re.Pattern="\[face=(.[^\[]*)\](.[^\[]*)\[\/face\]"
strContent=re.Replace(strContent,"$2")
re.Pattern="\[align=(center|left|right)\](.*)\[\/align\]"
strContent=re.Replace(strContent,"
$2
")

re.Pattern="\[QUOTE\](.*)\[\/QUOTE\]"
strContent=re.Replace(strContent,"
$1

")
re.Pattern="\[fly\](.*)\[\/fly\]"
strContent=re.Replace(strContent,"$1")
re.Pattern="\[move\](.*)\[\/move\]"
strContent=re.Replace(strContent,"$1")    
re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/GLOW]"
strContent=re.Replace(strContent,"$4
")
re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/SHADOW]"
strContent=re.Replace(strContent,"$4
")

re.Pattern="\[i\](.[^\[]*)\[\/i\]"
strContent=re.Replace(strContent,"$1")
re.Pattern="\[u\](.[^\[]*)(\[\/u\])"
strContent=re.Replace(strContent,"$1")
re.Pattern="\[b\](.[^\[]*)(\[\/b\])"
strContent=re.Replace(strContent,"$1")
re.Pattern="\[size=([1-4])\](.[^\[]*)\[\/size\]"
strContent=re.Replace(strContent,"$2")
strContent=replace(strContent,"","")
set re=Nothing
DvBcode=strContent
end function

function DvSignCode(strContent,PostUserGroup)
if Forum_Setting(66)<>1 then
    strContent = dvHTMLEncode(strContent)
else
    strContent = HTMLcode(strContent)
end if
if Forum_Setting(65)<>1 and PostUserGroup>2 then
    DvSignCode=strContent
    exit function
end if
dim re
dim reContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True

re.Pattern="(javascript)"
strContent=re.Replace(strContent,"javascript")
re.Pattern="(jscript:)"
strContent=re.Replace(strContent,"jscript:")
re.Pattern="(js:)"
strContent=re.Replace(strContent,"js:")
re.Pattern="(value)"
strContent=re.Replace(strContent,"value")
re.Pattern="(about:)"
strContent=re.Replace(strContent,"about:")
re.Pattern="(file:)"
strContent=re.Replace(strContent,"file:")
re.Pattern="(documents.cookie)"
strContent=re.Replace(strContent,"documents.cookie")
re.Pattern="(vbscript:)"
strContent=re.Replace(strContent,"vbscript:")
re.Pattern="(vbs:)"
strContent=re.Replace(strContent,"vbs:")
re.Pattern="(on(mouse|exit|error|click|key))"
strContent=re.Replace(strContent,"on$2")

if Forum_Setting(67)=1 or PostUserGroup<4 then
    re.Pattern="\[IMG\](http|https|ftp):\/\/(.[^\[]*)\[\/IMG\]"
    strContent=re.Replace(strContent,"screen.width-500)this.width=screen.width-500"">")
end if

if Forum_Setting(67)=1 or PostUserGroup<4 then
    re.Pattern="(\[FLASH\])(http://.[^\[]*(.swf))(\[\/FLASH\])"
    strContent= re.Replace(strContent,"点击开新窗口欣赏该FLASH动画![全屏欣赏]
$2")

    re.Pattern="(\[FLASH=*([0-9]*),*([0-9]*)\])(http://.[^\[]*(.swf))(\[\/FLASH\])"
    strContent= re.Replace(strContent,"点击开新窗口欣赏该FLASH动画![全屏欣赏]
$4")
end if

re.Pattern="(\[URL\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"$2")
re.Pattern="(\[URL=(.[^\[]*)\])(.[^\[]*)(\[\/URL\])"
strContent= re.Replace(strContent,"$3")

re.Pattern="(\[EMAIL\])(\S+\@.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"$2")
re.Pattern="(\[EMAIL=(\S+\@.[^\[]*)\])(.[^\[]*)(\[\/EMAIL\])"
strContent= re.Replace(strContent,"$3")

'自动识别网址
re.Pattern = "^((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1")
re.Pattern = "((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)$"
strContent = re.Replace(strContent,"$1")
re.Pattern = "([^>=""])((http|https|ftp|rtsp|mms):(\/\/|\\\\)[A-Za-z0-9\./=\?%\-&_~`@':+!]+)"
strContent = re.Replace(strContent,"$1$2")

'自动识别www等开头的网址
re.Pattern = "([^(http://|http:\\)])((www|cn)[.](\w)+[.]{1,}(net|com|cn|org|cc)(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=](\w)+)*)*)"
strContent = re.Replace(strContent,"$2")

'自动识别Email地址
're.Pattern = "([^(=)])((\w)+[@]{1}((\w)+[.]){1,3}(\w)+)"
'strContent = re.Replace(strContent,"$2")

if Forum_Setting(37) = "1" or PostUserGroup<4 then
    re.Pattern="\[em(.[^\[]*)\]"
    strContent=re.Replace(strContent,"")
end if

re.Pattern="\[color=(.[^\[]*)\](.[^\[]*)\[\/color\]"
strContent=re.Replace(strContent,"$2")
re.Pattern="\[face=(.[^\[]*)\](.[^\[]*)\[\/face\]"
strContent=re.Replace(strContent,"$2")
re.Pattern="\[align=(center|left|right)\](.[^\[]*)\[\/align\]"
strContent=re.Replace(strContent,"
$2
")

re.Pattern="\[GLOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/GLOW]"
strContent=re.Replace(strContent,"$4
")
re.Pattern="\[SHADOW=*([0-9]*),*(#*[a-z0-9]*),*([0-9]*)\](.[^\[]*)\[\/SHADOW]"
strContent=re.Replace(strContent,"$4
")

re.Pattern="\[i\](.[^\[]*)\[\/i\]"
strContent=re.Replace(strContent,"$1")
re.Pattern="\[u\](.[^\[]*)(\[\/u\])"
strContent=re.Replace(strContent,"$1")
re.Pattern="\[b\](.[^\[]*)(\[\/b\])"
strContent=re.Replace(strContent,"$1")
re.Pattern="\[size=([1-4])\](.[^\[]*)\[\/size\]"
strContent=re.Replace(strContent,"$2")
strContent=replace(strContent,"","")
set re=Nothing
DvSignCode=strContent
end function

function reUBBCode(strContent)
strContent = dvHTMLEncode(strContent)
dim re
Set re=new RegExp
re.IgnoreCase =true
re.Global=True

re.Pattern="(\[QUOTE\])(.[^\[]*)(\[\/QUOTE\])"
strContent=re.Replace(strContent,"")
re.Pattern="(\[point=*([0-9]*)\])(.*)(\[\/point\])"
strContent=re.Replace(strContent,"")
re.Pattern="(\[post=*([0-9]*)\])(.*)(\[\/post\])"
strContent=re.Replace(strContent,"")
re.Pattern="(\[power=*([0-9]*)\])(.*)(\[\/power\])"
strContent=re.Replace(strContent,"")
re.Pattern="(\[usercp=*([0-9]*)\])(.*)(\[\/usercp\])"
strContent=re.Replace(strContent,"")
re.Pattern="(\[replyview=*([0-9]*)\])(.*)(\[\/replyview\])"
strContent=re.Replace(strContent,"")
strContent=replace(strContent,"","")

set re=Nothing
reUBBCode=strContent
end function

Function FilterJS(v)
if not isnull(v) then
dim t
dim re
dim reContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(javascript)"
t=re.Replace(v,"javascript")
re.Pattern="(jscript:)"
t=re.Replace(t,"jscript:")
re.Pattern="(js:)"
t=re.Replace(t,"js:")
re.Pattern="(value)"
t=re.Replace(t,"value")
re.Pattern="(about:)"
t=re.Replace(t,"about:")
re.Pattern="(file:)"
t=re.Replace(t,"file:")
re.Pattern="(documents.cookie)"
t=re.Replace(t,"documents.cookie")
re.Pattern="(vbscript:)"
t=re.Replace(t,"vbscript:")
re.Pattern="(vbs:)"
t=re.Replace(t,"vbs:")
re.Pattern="(on(mouse|exit|error|click|key))"
t=re.Replace(t,"on$2")
re.Pattern="(&#)"
t=re.Replace(t,"&#")
FilterJS=t
set re=nothing
end if
End Function

function dvHTMLEncode(fString)
if not isnull(fString) then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")

fString = Replace(fString, CHR(32), " ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "

")
fString = Replace(fString, CHR(10), "
")

fString=ChkBadWords(fString)
dvHTMLEncode = fString
end if
end function
%>



我佛山人

职务:版主
等级:4
金币:16.0
发贴:2269
#32002/10/27 20:20:56
382行是fString = replace(fString, ">", ">")

禁止HTML标签的,看是不是你发的公告内容是什么?