aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Render.pm
Commit message (Expand)AuthorAge
* Fix escaping of filenames in historyurl. (Thanks, aj)Joey Hess2010-11-16
* Pass array of names of files that have been deleted to needsbuild hook as sec...Joey Hess2010-09-10
* needsbuild hook interface changed; the hooks should now return the modified a...Joey Hess2010-09-07
* Run the preprocess hooks in scan mode *before* the scan hooks.intrigeri2010-08-02
* Revert "Added a rescan hook."•••This reverts commit 25447bccae0439ea56da7a788482a4807c7c459d. intrigeri2010-08-02
* Added a rescan hook.•••This is needed for the po plugin vs. e.g. meta titles. In order to get rid of the ugly "rebuilding all pages to fix meta titles" thing, Joey suggested to make "po, at scan time, re-run the scan hooks, passing them modified content (either converted from po to mdwn or with the escaped stuff cheaply de-escaped)". This would unfortunately not work, as the meta plugin gathers its data using the preprocess hook in scan mode: it would overwrite with buggy data the correct data we would have forced it to gather in po's scan hook. We then need a hook that runs *after* the preprocess hook has been run in scan mode, but *before* any page rendering is started. Hence this one. intrigeri2010-07-30
* rcs_getctime and rcs_getmtime take relative filenames•••There was some confusion about whether the filename was relative to srcdir or not. Some test cases, and the bzr plugin assumed it was relative to the srcdir. Most everything else assumed it was absolute. Changed it to relative, for consistency with the rest of the rcs_ functions. Joey Hess2010-06-23
* avoid dying if cannot chdir to an underlaydirJoey Hess2010-06-17
* Make --gettime be honored after initial setup.•••Bugfix in passing: New files not treated as such when no rcs is used. Joey Hess2010-06-15
* fix other cases of unicode mixing issue•••and fix underlaydir override attack guard when srcdir is non-absolute Joey Hess2010-06-15
|\
| * Fix issues with combining unicode srcdirs and source files.•••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. Joey Hess2010-06-15
* | Fix issues with combining unicode srcdirs and source files.•••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 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 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. Joey Hess2010-06-15
|/
* Fix a bug that prevented matching deleted comments, and so did not update pag...•••Problem is that by the time rendering calls render_dependent, %pagesources has had deleted files removed from it. So match_comment's lookup of files in there to see if they had the _comment extension failed. I had to introduce a hash that temporarily holds filenames of deleted pages to fix this. Note that unlike comment(), internal() had avoided this pitfall by being defined to match both internal and non-internal pages. Joey Hess2010-05-18
* refactor template actionsJoey Hess2010-05-14
* nasty update to ugly hack to allow comment() pagespecs to workJoey Hess2010-05-07
* call delete hook even if only internal pages are deletedJoey Hess2010-05-07
* Delete hooks are passed deleted internal pages.•••Necessary so search can remove its indexes for internal pages. But also, it seems it was an omission not to pass the deleted pages before. Joey Hess2010-05-06
* inline: Call indexhtml when inlining internal pages, so their text can be ind...Joey Hess2010-05-06
* Renamed postscan hook to indexhtml, to reflect its changed position.•••Probably only the search plugin uses it, so this seemed safe. Joey Hess2010-05-06
* rename ispage variableJoey Hess2010-05-05
* remove unusedJoey Hess2010-05-05
* add ISPAGE variable to page.tmpl•••Plugins will also be able to use this to tell if the template is being used to generate a wiki page, when misctemplate starts also using page.tmpl. Joey Hess2010-05-05
* Fixes a bug in skipping of illegal source files introduced in 3.20100427.Joey Hess2010-05-04
* Add ACTIONS variable to page.tmpl, which allows plugins to add arbitrary link...•••(COMMENTSLINK and DISCUSSIONLINK could be folded into this, but are kept separate for now to avoid breaking modified templates.) Joey Hess2010-05-03
* Add parameter to displaytime to specify that it is a pubdate, and in html5 mo...Joey Hess2010-05-02
* html5 option•••* Ikiwiki can be configured to generate html5 instead of the default xhtml 1.0. The html5 output mode is experimental, not yet fully standards compliant, and will be subject to rapid change. Joey Hess2010-05-01
* loop on pagesources, not ctimeJoey Hess2010-04-26
* Fix removal of rendered files in rebuild mode.•••Needed to handle the move of the .js files into ikiwiki/, but also this is a longstanding bug. Old pagemtime is not remembered in rebuild mode, and changing that would need a lot of changes. So instead, loop on pagectime, which is remembered. Change to remembering old pagesources info in rebuild mode. This seems safe enough. Joey Hess2010-04-26
* rebuild on template removalJoey Hess2010-04-24
* bugfixesJoey Hess2010-04-24
* add support for mass dependencies•••Registered by passing "" as page name to add_depends. Joey Hess2010-04-24
* special case for page.tmpl dependency handling•••Rather than wasting resources recording that every page depends on page.tmpl, add a special case. The special case curretly rebuilds non-page files too when page.tmpl changes, but that's minor. Joey Hess2010-04-23
* look for templates in srcdir and underlays, first•••This entailed changing template_params; it no longer takes the template filename as its first parameter. Add template_depends to api and replace calls to template() with template_depends() in appropriate places, where a dependency should be added on the template. Other plugins don't use template(), so will need further work. Also, includes are disabled for security. Enabling includes only when using templates from the templatedir would be nice, but would add a lot of complexity to the implementation. Joey Hess2010-04-22
* Merge branch 'master' into autotag•••Conflicts: IkiWiki/Plugin/tag.pm Joey Hess2010-04-21
|\
| * fix false positive in link_types_changed•••loadindex does not bother populating oldtypedlinks if there is no link type. However, the code in link_types_changed assumed that if oldtypedlinks is not defined, and typedlinks is, they must differ. Joey Hess2010-04-21
* | remember autofiles that were tried and failed to be added•••This way, if an autofile is registered for a file that already exists, it is remembered that it was tried, and it doesn't get recreated when removed. Joey Hess2010-04-21
* | remember autofiles always•••This fixes the problem that it did not remember if an autofile is deleted, unless a plugin happened to register the autofile at the same time. With the new code, we just never recreate an autofile more than once. Only downside is that the list of autofiles is never pruned either. And I don't really see a way to prune it. Joey Hess2010-04-21
* | bugfixesJoey Hess2010-04-21
* | remove verify_src_file•••Splitting out this function bothered me. It is conceptially similar to file_pruned, and yet also very specific to exactly the security needs of find_src_files. I liked that it got rid of duplicate code in the latter function. So instead, put a helper sub in that, which I think allows refactoring things more cleanly, and with less boilerplate. As to the needs of gen_autofile, I'm not convinced this needs to handle the same set of problems that verify_src_file did. So I sat down and wrote a custom validator for autofiles, which turned out to seem to just need three things: Make sure the candidate filename is not something that would be pruned; untaint the candidate filename; and make sure that srcdir doesn't already have something with its name. (Plus, of course, all the other checks that were already in gen_autofile.) (In passing, also fixed a bunch of bugs I had introduced in this branch.) Joey Hess2010-04-21
* | Merge branch 'master' into autotagJoey Hess2010-04-20
|\|
| * fix minor bug if a page's name is "0"Joey Hess2010-04-20
| * change wording•••This is more accurate when a file that is not a page is what is removed. Joey Hess2010-04-19
| * move message into if blockJoey Hess2010-04-19
* | move File::Find control back into its code blocks•••Ok, this is longer, but features less scary action at a distance. Joey Hess2010-04-17
* | move decode_utf8 closer to reason for it•••Filenames need to be decoded, as File::Find does not provide them in decoded form, but other callers of verify_src_file will be using utf8. Joey Hess2010-04-17
* | refactor autofiles•••Made add_autofile take a generator function, and just register the autofile, for later possible creation. The testing is moved into Render, which allows cleaning up some stuff. Joey Hess2010-04-17
* | whitespaceJoey Hess2010-04-17
* | Merge remote branch 'davrieb/autotag' into autotag•••Conflicts: IkiWiki.pm IkiWiki/Plugin/tag.pm Joey Hess2010-04-17
|\ \ | |/ |/|
| * Make sure deleted tag pages don't get recreated.•••The reason to do this is basically a user interaction design decision. It is achieved by adding an entry, associated to the creating plugin, to %pagestate. To find out if files were deleted a new global hash %del_hash is %introduced. David Riebenbauer2010-04-03
| * Revert "Revert the effects of find_del_files() for (re)autoadded files."•••This reverts commit 31680111f0062f07727d14fcf291c98978ad5a2f. David Riebenbauer2010-04-03