Hi,
How can I stop stuff I'm passing in a loop, from getting encoded?
while (my $hit = $sth->fetchrow_hashref) {
push @entries, $hit;
}
print GForum::Template->parse_print('guestbook_view.html' , { %$vars, entries_loop => \@entries } );
..and the value of $hit->{Contents} gets HTML encoded, thus shows all the HTML, instead of what its mean't to!
I've found a solution:
while (my $hit = $sth->fetchrow_hashref) {
push @entries, { %$hit, Contents => \$hit->{Contents} };
}
print GForum::Template->parse_print('guestbook_view.html' , { %$vars, entries_loop => \@entries } );
.. but surely there has to be a better way? :/
TIA
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
How can I stop stuff I'm passing in a loop, from getting encoded?
Code:
my @entries; while (my $hit = $sth->fetchrow_hashref) {
push @entries, $hit;
}
print GForum::Template->parse_print('guestbook_view.html' , { %$vars, entries_loop => \@entries } );
..and the value of $hit->{Contents} gets HTML encoded, thus shows all the HTML, instead of what its mean't to!
I've found a solution:
Code:
my @entries; while (my $hit = $sth->fetchrow_hashref) {
push @entries, { %$hit, Contents => \$hit->{Contents} };
}
print GForum::Template->parse_print('guestbook_view.html' , { %$vars, entries_loop => \@entries } );
.. but surely there has to be a better way? :/
TIA
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!