Gossamer Forum
Home : Products : Gossamer Links : Discussions :

suggestion: html_escape build_title_linked

Quote Reply
suggestion: html_escape build_title_linked
Hi,

I just stepped over one thing I wanted to have - probably there are more cases like that - where html_escaping would be nice.
In Build.pm :

Code:
sub build_title_linked {
# ------------------------------------------------------------------
# Generate a linked title.
#
my $input = shift;
my $complete = 0;
my $home = 1;
if (ref $input) {
$complete = $input->{complete} || 0;
$home = defined $input->{home} ? $input->{home} : 1;
$input = $input->{name};
}

my $db = $DB->table('Category');
my $top = Links::language('LINKS_TOP');

my @dirs = split /\//, $input;
my $last;
$last = pop @dirs unless $complete;

my @paths;
push @paths, qq{<a href="$CFG->{build_root_url}/} . ($CFG->{build_home} || ($CFG->{build_index_include} ? $CFG->{build_index} : '')) . qq{">$top</a>} if $home;
for (0 .. $#dirs) {
my $path = "/" . $db->as_url(join "/", @dirs[0 .. $_]);
#old push @paths, qq{<a href="$CFG->{build_root_url}$path/} . ($CFG->{build_index_include} ? $CFG->{build_index} : '') . qq{">$dirs[$_]</a>};
push @paths, qq{<a href="$CFG->{build_root_url}$path/} . ($CFG->{build_index_include} ? $CFG->{build_index} : '') . qq{">} . GT::CGI->html_escape($dirs[$_]) . qq{</a>};
}
push @paths, $last unless $complete;
return join ': ', @paths;
}
END_OF_SUB
pros and cons are welcome

Regards

n||i||k||o
Subject Author Views Date
Thread suggestion: html_escape build_title_linked el noe 2551 Jan 5, 2011, 4:39 PM
Thread Re: [el noe] suggestion: html_escape build_title_linked
brewt 2440 Jan 5, 2011, 4:59 PM
Post Re: [brewt] suggestion: html_escape build_title_linked
el noe 2420 Jan 6, 2011, 5:55 AM