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 :
# ------------------------------------------------------------------
# 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_SUBpros and cons are welcome
Regards
n||i||k||o
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
Regards
n||i||k||o