I would allow only basic tags like bold or italic ( up to 4-5 ), as common user probally won't bother with other anyway...but it depends on the stucture of your page and the whole idea. In such case you wouldn't have problems with <script> tags... Just scan the string and remove everything with <> except for tags you want to allow.
cheers
Main Topics
Browse All Topics





by: anandkpPosted on 2003-07-04 at 02:30:31ID: 8855334
Hi Brad
========== ========== ========== ========== ========== ========== ========== ========== =========
p>
========== ========== ========== ========== ========== ========== ========== ========== =========
p>
pls copy & paste this file on ur machien & run it - let me know - if thats what ur looking for ?
<!--- Anand K Patel --->
<CFparam DEFAULT="" NAME="x">
<form name"frm" ACTION="x.cfm" METHOD="post">
<textarea name="x" ROWS="10" COLS="50" wrap="virtual">
type in ur text here with html & cf tags + type as much test u want here
so as to make it to "XX" chars & see what output u get
</TEXTAREA>
<INPUT TYPE="submit">
</FORM>
==========================
<BR>
from CFDOCS : Returns HTML escaped string. All carriage returns are removed from string, and all special characters (> < " &) are escaped.
all carriage returns are trimmed off automatically
<BR>
<CFOUTPUT>
<P><B>Output :</B>#HTMLEditFormat(x)#</
</CFOUTPUT>
==========================
Option -> carriage returns & special chars - taken care off automatically
<BR>
<CFOUTPUT>
<P><B>Output :</B>#HTMLCodeFormat(x)#</
</CFOUTPUT>
<BR>
K'Rgds
Anand