attachment: Support old versions of CGI.pm that lack an upload method.
authorJoey Hess <joey@kodama.kitenet.net>
Tue, 8 Jul 2008 14:42:58 +0000 (10:42 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 8 Jul 2008 14:42:58 +0000 (10:42 -0400)
IkiWiki/Plugin/attachment.pm
debian/changelog

index 90e0f0f0b1e7b8e419cf1d1679d751d10a8e54b6..f4f64b46a54ec9ad574cebf3b7715080d0882343 100644 (file)
@@ -133,7 +133,11 @@ sub formbuilder (@) { #{{{
                else {
                        my $fh=$q->upload('attachment');
                        if (! defined $fh || ! ref $fh) {
-                               error("failed to get filehandle");
+                               # needed by old CGI versions
+                               $fh=$q->param('attachment');
+                               if (! defined $fh || ! ref $fh) {
+                                       error("failed to get filehandle");
+                               }
                        }
                        binmode($fh);
                        writefile($filename, $config{srcdir}, undef, 1, sub {
index eee1a01b915cf98d81761834c842c26040b3bcfc..66ccc5b6082685055c6b9b04966fdae2f91e9f71 100644 (file)
@@ -5,6 +5,7 @@ ikiwiki (2.53) UNRELEASED; urgency=low
   * attachment: Fix an uninitialised value warning when editing a page
     that currently has no attachments.
   * Fix a bug with links to pages whose names contained colons.
+  * attachment: Support old versions of CGI.pm that lack an upload method.
 
  -- Joey Hess <joeyh@debian.org>  Mon, 07 Jul 2008 01:52:48 -0400