ikiwiki/doc
Joey Hess ad02f69836 attachment: Support perl 5.8's buggy version of CGI.pm.
This is truely horribly disgusting. CGI::tmpFileName, in current perls, is
an undocumented function (which should be a clue..) that takes the original
filename of an uploaded attachment, and returns the name of the tempfile
that CGI has stored it in.

In old perls, though, CGI::tmpFileName does not take a filename. It takes
a key from the object's {'.tmpfiles'} hash. This key is something
crazy like '*Fh::fh00001group' -- apparently the stringification of a
filehandle object.

Just to add to the fun, tmpFileName doesn't take the key, it expects a
refernce to the key. Argh?!

But the fun doesn't stop there, because in perl 5.8, CGI.pm is also broken
in two other ways. The upload() method is supposed to return a filehandle
to the temp file. It doesn't. The param() method is supposed to return
a filehandle to the temp file, that stringifies to the original filename.
It returns just the original filename, no filehandle.

Combine all these bugs, and you end up with this disgusting commit. Since
I have no way to get the filehandle, I *need* to get the tempfile name.
If I had the filehandle, I could probably pass it into tmpFileName, and
it might strigify to the right key name. But I don't, so the only way to
determine the key is to grub through the .tmpfiles hash ourselves.

And finally, one the temp file name is discovered, a filehandle can finally
be obtained by (re)opening it.

I recommend that this commit be reverted when perl 5.8 is a mercifully
faded memory.

I'm really, really, really glad I'm actually being paid for working on
this right now!
2008-07-08 18:10:53 -04:00
..
banned_users
basewiki
bugs attachment: Support perl 5.8's buggy version of CGI.pm. 2008-07-08 18:10:53 -04:00
cgi rm 2008-07-08 16:18:11 -04:00
contact
css_market
examples remove question that was added to a non-discussion page 2008-04-22 15:19:15 -04:00
forum
ikiwiki example of how to limit to specific directory 2008-07-07 12:12:48 -04:00
ikiwiki-mass-rebuild
ikiwikiusers
index web commit by buo: remove utf-8 rant; my problem was fixed in 2.46. 2008-05-14 09:51:23 -04:00
install web commit by http://vibrog.myopenid.com/ 2008-04-30 16:25:30 -04:00
logo
news add news item for ikiwiki 2.52 2008-07-06 19:24:48 -04:00
plugins typo the second 2008-07-07 12:08:45 -04:00
post-commit
rcs web commit by simon: link fix 2008-06-28 16:51:57 -04:00
roadmap
sandbox web commit by http://willthompson.co.uk/ 2008-05-31 10:08:17 -04:00
security
setup response; fixed 2008-04-26 15:07:21 -04:00
smileys
soc
tags
templates reorder 2008-05-15 16:56:28 -04:00
tips response 2008-06-20 19:42:09 -04:00
todo web commit by http://jcflack.myopenid.com/ 2008-07-08 09:29:19 -04:00
translation
usage
users remove; user also has a bbb page 2008-07-06 13:59:35 -04:00
w3mmode
wikiicons
GPL
TourBusStop.mdwn
backlinks.mdwn
banned_users.mdwn
basewiki.mdwn
bugs.mdwn
cgi.mdwn
commit-internals.mdwn
consultants.mdwn add consultant list, add news item 2008-06-12 16:34:18 -04:00
contact.mdwn add a link to the forum 2008-05-15 17:00:05 -04:00
css.mdwn
css_market.mdwn
download.mdwn web commit by http://arnebab.livejournal.com/: Fixed Gentoo ebuild link (old one pointed directly to the download) 2008-06-23 20:12:20 -04:00
examples.mdwn add link to css market 2008-06-02 17:46:52 -04:00
favicon.ico
features.mdwn search: Converted to use xapian-omega. 2008-06-03 15:29:54 -04:00
forum.mdwn
freesoftware.mdwn clarification 2008-05-07 16:35:06 -04:00
git.mdwn
ikiwiki-makerepo.mdwn
ikiwiki-mass-rebuild.mdwn
ikiwiki-transition.mdwn documentation for use of hashed passwords 2008-05-29 15:17:19 -04:00
ikiwiki-update-wikilist.mdwn
ikiwiki.mdwn finishing touches on the new search plugin 2008-06-04 15:24:28 -04:00
ikiwiki.setup add virus checking to attachments plugin 2008-07-06 17:36:26 -04:00
ikiwikiusers.mdwn add dist-bugs 2008-07-08 14:18:09 -04:00
index.mdwn
install.mdwn documentation for use of hashed passwords 2008-05-29 15:17:19 -04:00
local.css
logo.mdwn
news.mdwn
page_locking.mdwn
pagehistory.mdwn
patch.mdwn
plugins.mdwn remove map, was added for testing and committed by accident 2008-06-29 14:15:33 -04:00
post-commit.mdwn
rcs.mdwn
recentchanges.mdwn
roadmap.mdwn
sandbox.mdwn test 2008-07-07 19:15:14 -04:00
security.mdwn update 2008-07-02 16:47:29 -04:00
setup.mdwn update 2008-05-05 19:14:33 -04:00
shortcuts.mdwn web commit by http://madduck.net/: add shortcut for wiki.debian.org 2008-05-10 09:28:14 -04:00
sitemap.mdwn
smileys.mdwn
soc.mdwn attachment doc updates 2008-07-01 17:54:23 -04:00
style.css img: Support captions. 2008-06-07 23:45:40 -04:00
tags.mdwn
templates.mdwn
tipjar.mdwn add consultant list, add news item 2008-06-12 16:34:18 -04:00
tips.mdwn fix 2007-05-28 23:32:45 +00:00
todo.mdwn
translation.mdwn
usage.mdwn add a link to ikiwiki-transition 2008-05-15 16:54:41 -04:00
users.mdwn ignore user subpages 2008-06-12 15:43:40 -04:00
w3mmode.mdwn
whyikiwiki.mdwn
wikitemplates.mdwn search: Converted to use xapian-omega. 2008-06-03 15:29:54 -04:00
wishlist.mdwn clarify how an item is wishlisted 2008-07-07 16:40:28 -04:00