Gossamer Forum
Home : Products : Links 2.0 : Customization :

HTML in tags messes up dB?

Quote Reply
HTML in tags messes up dB?
Hi,
I have one link holder who keeps messing up my dB. They stick html in the description, and all it does is mess up their entry.

I've never seen anyone mention this. Has anyone had this problem?
Quote Reply
Re: HTML in tags messes up dB? In reply to
You have to put this code somewhere.

shift $_;
$_ =~ s/</</g;
$_ =~ s/>/>/g;
return $_;

I'm not too sure where though.
Quote Reply
Re: HTML in tags messes up dB? In reply to
The most obvious place would be in sub site_html_link of either site_html.pl or site_html_templates.pl. However, the code provided by CEGlobe doesn't really change anything since it substitutes the same symbol for itself. I think his idea was to remove the symbol.

Add the following to the subroutine in site_html_templates.pl just before the return template code:

Code:
if ($rec{'Description'}) {
$rec{'Description'} =~ s/<//g;
$rec{'Description'} =~ s/>//g;

In site_html.pl, change this:

Code:
if ($rec{'Description'}) {
$output .= qq~ <span class="descript">- $rec{'Description'}</span>\n~; }

to read:

Code:
if ($rec{'Description'}) {
$rec{'Description'} =~ s/<//g;
$rec{'Description'} =~ s/>//g;
$output .= qq~ <span class="descript">- $rec{'Description'}</span>\n~; }

All this code does is removes the "<" and ">" symbols from around the html code, effectively converting the html code to normal text.

I hope this helps.
Quote Reply
Re: HTML in tags messes up dB? In reply to
Thanks Bobsie!
I will study what you say as soon as I get my much troubling issue of the sort sequence happening alphabetically fixed.

Dennis has looked over my code and he says it all looks normal...I keep going over every line of code again and again but I just can't figure out what's going on....