]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/attachment.pm
fix PageSpec ref
[ikiwiki.git] / IkiWiki / Plugin / attachment.pm
index fd4096edf7de153ef01145f310c459f255e3fffc..133a54dafd718f15cb763503c7d9b5d80b17d577 100644 (file)
@@ -148,7 +148,7 @@ sub formbuilder (@) {
                        $f=Encode::decode_utf8($f);
                        $f=~s/^$page\///;
                        if (IkiWiki::isinlinableimage($f) &&
-                           UNIVERSAL::can("IkiWiki::Plugin::img", "import")) {
+                           IkiWiki::Plugin::img->can("import")) {
                                $add.='[[!img '.$f.' align="right" size="" alt=""]]';
                        }
                        else {
@@ -272,6 +272,7 @@ sub attachments_save {
        my @attachments;
        my $dir=attachment_holding_location($form->field('page'));
        foreach my $filename (glob("$dir/*")) {
+               $filename=Encode::decode_utf8($filename);
                next unless -f $filename;
                my $destdir=$config{srcdir}."/".
                        linkpage(IkiWiki::possibly_foolish_untaint(
@@ -345,6 +346,7 @@ sub attachment_list ($) {
        my $dir=attachment_holding_location($page);
        my $heldmsg=gettext("this attachment is not yet saved");
        foreach my $file (glob("$dir/*")) {
+               $file=Encode::decode_utf8($file);
                next unless -f $file;
                my $base=IkiWiki::basename($file);
                my $f=$loc.$base;