summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-08 10:42:58 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-08 10:42:58 -0400
commit71f10579c00a8ddc20ada1a1efd33aac25a3da7e (patch)
treecaaa51696b0dc5f71820dcf8603242119fa4af57
parent0ffe0872c17961da61246c61f06102f8711661b3 (diff)
attachment: Support old versions of CGI.pm that lack an upload method.
-rw-r--r--IkiWiki/Plugin/attachment.pm6
-rw-r--r--debian/changelog1
2 files changed, 6 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 90e0f0f0b..f4f64b46a 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -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 {
diff --git a/debian/changelog b/debian/changelog
index eee1a01b9..66ccc5b60 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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