summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/autoindex.pm
AgeCommit message (Collapse)Author
2010-06-23rcs_commit and rcs_commit_staged api changesJoey Hess
Using named parameters for these is overdue. Passing the session in a parameter instead of passing username and IP separately will later allow storing other session info, like username or part of the email. Note that these functions are not part of the exported API, and the prototype change will catch (most) skew, so I am not changing API versions. Any third-party plugins that call them will need updated though.
2010-06-17avoid dying if cannot chdir to an underlaydirJoey Hess
2010-06-15Fix issues with combining unicode srcdirs and source files.Joey Hess
A short story: Once there was a unicode string, let's call him Srcdir. Along came a crufy old File::Find, who went through a tree and pasted each of the leaves in turn onto Srcdir. But this 90's relic didn't decode the leaves -- despite some of them using unicode! Poor Srcdir, with these leaves stuck on him, tainted them with his nice unicode-ness. They didn't look like leaves at all, but instead garbage. (In other words, perl's unicode support sucks mightily, and drives us all to drink and bad storytelling. But we knew that..) So, srcdir is not normally flagged as unicode, because typically it's pure ascii. And in that case, things work ok; File::Find finds filenames, which are not yet decoded to unicode, and appends them to the srcdir, and then decode_utf8 happily converts the whole thing. But, if the srcdir does contain utf8 characters, that breaks. Or, if a Yaml setup file is used, Yaml::Syck's implicitunicode sets the unicode flag of *all* strings, even those containing only ascii. In either case, srcdir has the unicode flag set; a non-decoded filename is appended, and the flag remains set; and decode_utf8 sees the flag and does *nothing*. The result is that the filename is not decoded, so looks valid and gets skipped. File::Find only sticks the directory and filenames together in no_chdir mode .. but we need that mode for security. In order to retain the security, and avoid the problem, I made it not pass srcdir to File::Find. Instead, chdir to the srcdir, and pass ".". Since "." is ascii, the problem is avoided. Note that chdir srcdir is safe because we check for symlinks in the srcdir path. Note that it takes care to chdir back to the starting location. Because the user may have specified relative paths and so staying in the srcdir might break. A relative path could even be specifed for an underlay dir, so it chdirs back after each.
2010-04-20bugfixJoey Hess
So this is the one place that does need to canonpath and compare, as two argument file_pruned used to.
2010-04-20oops, fix for no_chdir modeJoey Hess
$_ will be absolute then
2010-04-20switch to 1 parameter version of file_prunedJoey Hess
Another bit of code that didn't realize that File::Find sets $_ to the relative filename.
2010-04-17autoindex: Switch to using %wikistate instead of abusing $pagestate{index}.Joey Hess
2010-02-12setup file orderingJoey Hess
2010-02-12add section informationJoey Hess
2008-12-23finalise version 3.00 of the plugin apiJoey Hess
2008-12-17Coding style change: Remove explcit vim folding markers.Joey Hess
2008-10-06avoid $_ in a few other for loopsJoey Hess
These were probably not currently buggy, but let's avoid bugs being introduced by the functions called clobbering $_.
2008-09-29support indexpagesJoey Hess
2008-08-26autoindex: Avoid re-adding previously deleted (or renamed) pages.Joey Hess
2008-08-06autoindex: Ignore internal pages, and take underlay directories into ↵Joey Hess
account. Also, avoid making index pages for directories that contain no files.
2008-08-03add plugin safe/rebuild info (part 1 of 2)Joey Hess
too many plugins.. brain exploding..
2008-07-29check generated pages inJoey Hess
I considered not checking them in, or making the checkin configurable. However, then they would remain not checked in if edited by a user, which is probably not desired. Note that passing undef as the username/ip to rcs_commit_staged may not result in ideal behavior; the commit may seem to come from "anonymous" with some revision control systems. Most of them handle it a bit better and just have it come from whatever user is running the build.
2008-07-29initial draftJoey Hess