From: Joey Hess Date: Mon, 4 Feb 2008 22:58:23 +0000 (-0500) Subject: * inline: When previewing, still call will_render on rss/atom files, X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/d1c4899a22c99febfd46d6f2e28803ecf5d7288f * inline: When previewing, still call will_render on rss/atom files, just avoid actually writing the files. This is necessary because ikiwiki saves state after a preview (in case it actually *did* write files), and if will_render isn't called its security checks will get upset when the page is saved. Thanks to Edward Betts for his help tracking this tricky bug down. --- diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 796cf2cf6..ae3f8f409 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -95,7 +95,6 @@ sub preprocess_inline (@) { #{{{ my $atom=($config{atom} && exists $params{atom}) ? yesno($params{atom}) : $config{atom}; my $quick=exists $params{quick} ? yesno($params{quick}) : 0; my $feeds=exists $params{feeds} ? yesno($params{feeds}) : !$quick; - $feeds=0 if $params{preview}; my $feedonly=yesno($params{feedonly}); if (! exists $params{show} && ! $archive) { $params{show}=10; @@ -285,7 +284,7 @@ sub preprocess_inline (@) { #{{{ @list=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @list; } - if ($rss) { + if ($rss && ! $params{preview}) { my $rssp=rsspage($params{destpage}).$feednum; will_render($params{destpage}, $rssp); writefile($rssp, $config{destdir}, @@ -293,7 +292,7 @@ sub preprocess_inline (@) { #{{{ $toping{$params{destpage}}=1 unless $config{rebuild}; $feedlinks{$params{destpage}}=qq{}; } - if ($atom) { + if ($atom && ! $params{preview}) { my $atomp=atompage($params{destpage}).$feednum; will_render($params{destpage}, $atomp); writefile($atomp, $config{destdir}, diff --git a/debian/changelog b/debian/changelog index a1100500f..8220e162b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,12 @@ ikiwiki (2.31) UNRELEASED; urgency=low direction. No need to pull changes when doing a commit. mtn sync is still called in rcs_update. - Support for viewing differences via patches using viewmtn. + * inline: When previewing, still call will_render on rss/atom files, + just avoid actually writing the files. This is necessary because ikiwiki + saves state after a preview (in case it actually *did* write files), + and if will_render isn't called its security checks will get upset + when the page is saved. Thanks to Edward Betts for his help tracking this + tricky bug down. -- Joey Hess Sat, 02 Feb 2008 23:36:31 -0500