This is in regards to the
There is a (minor) spelling mistake in Line 1732 - problem is prolbem
Line 1732
<p align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">There was a prolbem</font></p>
And in regards to the chkString function (starting at Line 378)
Having read that Select statements process quicker than multiple if statements, would writing that function using a select statement be worthwhile? It's a highly used function - could be worth optimizing.
Original
if fField_Type = "title" then
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
chkBadWords(fString)
chkString = fString
exit function
end if
if fField_Type = "password" then
fString = trim(fString)
chkString = fString
end if
if fField_Type = "decode" then
fString = HTMLDecode(fString)
chkString = fString
exit function
end if
if fField_Type = "urlpath" then
fString = Server.URLEncode(fString)
chkString = fString
exit function
end if
if fField_Type = "SQLString" then
fString = Replace(fString, "'", "''")
fString = HTMLEncode(fString)
chkString = fString
exit function
end if
if fField_Type = "JSurlpath" then
fString = Replace(fString, "'", "\'")
fString = Server.URLEncode(fString)
chkString = fString
exit function
end if
if fField_Type = "display" then
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
chkString = fString
exit function
elseif fField_Type = "message" then
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
elseif fField_Type = "preview" then
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
elseif fField_Type = "hidden" then
fString = HTMLEncode(fString)
end if
Rewritten as Select Case
Select Case fField_Type
Case "title"
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
chkBadWords(fString)
chkString = fString
exit function
Case "password"
fString = trim(fString)
chkString = fString
Case "decode"
fString = HTMLDecode(fString)
ChkString = fString
exit function
Case "urlpath"
fString = Server.URLEncode(fString)
ChkString = fString
exit function
Case "SQLString"
fString = Replace(fString, "'", "''")
fString = HTMLEncode(fString)
ChkString = fString
exit function
Case "JSurlpath"
fString = Replace(fString, "'", "\'")
fString = Server.URLEncode(fString)
ChkString = fString
exit function
Case "display"
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
ChkString = fString
exit function
Case "message"
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
Case "preview"
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
Case "hidden"
fString = HTMLEncode(fString)
End Select