Log in

View Full Version : Allow HTML but forbid JavaScript in signatures?


dengel
03-26-2002, 12:59 PM
Is there a way to allow HTML in signatures, but not JavaScript? The reasons should be obvious enough. I did a search, and did not find anything. Should be a change easy to do, right?

d.

Admin
03-26-2002, 01:00 PM
Javascript is automatically removed from all texts in vBulletin:
javascript:xxx

dengel
03-26-2002, 01:10 PM
Does not seem to be. I've got an user with JavaScript on his signature that works fine. I do have HTML enabled for signatures, and I'd like to block JavaScript.. or the whole <script> tag.
d.

okrogius
03-26-2002, 01:22 PM
Go to admin cp. vB Options. Add the <script> into the to censor word list.

dengel
03-26-2002, 01:48 PM
That censor thing did the trick. But I went to printthread.php and added: $post[signature] = eregi_replace("< *SCRIPT", "<!--", $post[signature]);
$post[signature] = eregi_replace("< */SCRIPT *>", "-->", $post[signature]);afterif ($post[showsignature] and $allowsignatures and trim...Not optimal, but seems to work :)

d.

dengel
03-26-2002, 01:52 PM
No...that did *not* work. I guess I'll use the censor thing then. Oh well.... :(

d.

Dan203
03-26-2002, 05:29 PM
The problem is that users can use event handlers to launch scripts (i.e. onClick, onLoad, etc...) So you'd need to block all event handlers to prevent scripts from lauching. The problem with that is that IE supports tons of their own propritary event handlers, so it would be a lot of work.

Dan

dengel
03-26-2002, 05:34 PM
I see your point...

d.