ID:153248
Aug 25 2004, 7:09 am
|
|
What do u think is the best way to block HTML from Say() and World Chat(). i tried blocking phrases such as <font size and <font but ive found that i could get by that but doing <font___size(adding spaces not and underscore). Any help is appreciated.
|
In response to Jon Snow
|
|
but what if sum1 wanted to tell sum1 how to make a certain HTML tag. they couldnt use <>. or if they wanted to use it for sumthin else
|
In response to Mike H
|
|
o thanks that just wat i wantd. i was lookign for sumthin liek this in the ref but i guess i missed it =(
|
In response to FinalFantasyGamer
|
|
tell them to do it through pager
|
In response to Mike H
|
|
Mike H wrote:
html_encode() or ProcessHTML() if you want to allow some tags (or just certain arguments of some tags) and disable others. :) |
In response to Mike H
|
|
While html_encode() is nice, and all, I think it should really be two procs. It seems to me to preform a dual action of changing the < and > characters to < and > but it also modifies other non-transmittable characters, like ' and " and & and others.
I found this to be a big problem in Chatters, as html_encoding would break links, like when you link to a forum post. It seems like html_encode() was a muddled idea which was only half-implemented in two differeing directions. One was to disable the use of html, the other to mask non-transmittable characters, like '. Oddly enough, it doesn't mask the space character, so it's use in URLifying is null, and it's intereference with normal BYOND features, like autolinks makes it only half as good as it could be. I use 2 procs I wrote myself in Chatters to handle disabling and stripping html in messages. The first one swaps < for < and > for > like html_encode() does, but it skips over those parts of the mesage that would be auto-linked, preserving the link. I call this one http_encode(), but the name is not very descriptive, becuase it doesn't encode things to be URL friendly. Anyways, here's that proc: proc My second proc simply removes everything between < and >, including the brackets. Use this when you don't even want the raw html code to show: proc Both of these procs work, and have been used heavily in Chatters for quite some time with no errors or bugs. Hope that helps. ~X |
In response to Xooxer
|
|
My version of strip_html(), developed independently for The Haven Seed on December 2003:
proc/strip_html(string) |
In response to Spuzzum
|
|
I never thought of using one loop. :P Very nicely done.
~X |
since those are the core symbols used for html