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
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
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
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

