summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/attachment.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 9c774557f..ce688ca40 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -134,9 +134,12 @@ sub formbuilder (@) {
}
}
+ $filename=IkiWiki::basename($filename);
+ $filename=~s/.*\\+(.+)/$1/; # hello, windows
+
$filename=linkpage(IkiWiki::possibly_foolish_untaint(
attachment_location($form->field('page')).
- IkiWiki::basename($filename)));
+ $filename));
if (IkiWiki::file_pruned($filename)) {
error(gettext("bad attachment filename"));
}