<shudder>
That code of mine was so bad, I'd like to think I could write something better than that now :)
You should be aware of security issues with allowing html for example I could enter:
for (var i = 0; i < 10000000; i++) {
alert("Hah!");
}
</script>
...along with my resource :)
If you really want it though:
my ($full_Story) = GT::CGI::html_escape($_[0]->{Full_Story}) =~ s/\n/<BR>\n/g;
$full_story =~ s/\[([^\]]+)\]/<$1>/g;
return $full_story;
}
That will convert [anything] to <anything>
That code of mine was so bad, I'd like to think I could write something better than that now :)
You should be aware of security issues with allowing html for example I could enter:
Code:
<script language="javascript"> for (var i = 0; i < 10000000; i++) {
alert("Hah!");
}
</script>
...along with my resource :)
If you really want it though:
Code:
sub { my ($full_Story) = GT::CGI::html_escape($_[0]->{Full_Story}) =~ s/\n/<BR>\n/g;
$full_story =~ s/\[([^\]]+)\]/<$1>/g;
return $full_story;
}
That will convert [anything] to <anything>