From: Steinar H. Gunderson Date: Tue, 9 Aug 2005 22:26:38 +0000 (+0000) Subject: Show the rest of the filename if we truncate. X-Git-Url: https://git.sesse.net/?p=webpdf;a=commitdiff_plain;h=9e222deaa06f3f95696a8632eb48a0696a11568e Show the rest of the filename if we truncate. --- diff --git a/last.pl b/last.pl index 6024739..3576ba9 100755 --- a/last.pl +++ b/last.pl @@ -58,9 +58,13 @@ for my $t (@thumbnails[0..$pdfweb::config::show_last-1]) { close DESC; if (length($desc) > 30) { - $desc = substr($desc, 0, 30) . " ..."; + # Is this abuse? + $desc = HTML::Entities::encode_entities(substr($desc, 0, 30)) . " ..."; + } else { + $desc = HTML::Entities::encode_entities($desc); } - $desc = HTML::Entities::encode_entities($desc); my $time = (stat($t))[9]; my $date = POSIX::strftime("%Y-%m-%d %H:%M", localtime($time));