aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-06-14 15:19:23 -0400
committerJoey Hess <joey@kitenet.net>2011-06-14 15:19:23 -0400
commit49e7bc253569c809ba5d4d9e52f8a38ae8c183f7 (patch)
tree638126fb4b7bf78310c4904d7b0de533d5423676
parenta61849e95496027d07c38219d5cc47fe37b5aa25 (diff)
downloadikiwiki-49e7bc253569c809ba5d4d9e52f8a38ae8c183f7.tar
ikiwiki-49e7bc253569c809ba5d4d9e52f8a38ae8c183f7.tar.gz
bugfixes
-rw-r--r--IkiWiki/Plugin/attachment.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index ea40379ff..f97ab45a4 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -322,12 +322,13 @@ sub attachment_list ($) {
my $dir=attachment_holding_dir($page);
my $heldmsg=gettext("this attachment is not yet saved");
foreach my $file (glob("$dir/*")) {
- my $mtime=(stat($file))[9];
- my $f=$file;
- $f=~s/^\Q$dir\E\///;
+ next unless -f $file;
+ my $mtime=(stat(_))[9];
+ my $base=IkiWiki::basename($file);
+ my $f=$loc.$base;
$attachments{$f}={
- $std->($page."/".$f, (stat($file))[9], (stat($file))[7]),
- link => "<span title=\"$heldmsg\">$f</span>",
+ $std->($f, (stat($file))[9], (stat(_))[7]),
+ link => "<span title=\"$heldmsg\">$base</span>",
}
}