diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index debaf55e82..466fa8aad4 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4347,17 +4347,24 @@ sub fill_project_list_info {
# print 'sort by'
element, generating 'sort by $name' replay link
# if that order is not selected
sub print_sort_th {
+ print format_sort_th(@_);
+}
+
+sub format_sort_th {
my ($name, $order, $header) = @_;
+ my $sort_th = "";
$header ||= ucfirst($name);
if ($order eq $name) {
- print " | $header | \n";
+ $sort_th .= "$header | \n";
} else {
- print "" .
- $cgi->a({-href => href(-replay=>1, order=>$name),
- -class => "header"}, $header) .
- " | \n";
+ $sort_th .= "" .
+ $cgi->a({-href => href(-replay=>1, order=>$name),
+ -class => "header"}, $header) .
+ " | \n";
}
+
+ return $sort_th;
}
sub git_project_list_body {