]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* inline: When previewing, still call will_render on rss/atom files,
authorJoey Hess <joey@kodama.kitenet.net>
Mon, 4 Feb 2008 22:58:23 +0000 (17:58 -0500)
committerJoey Hess <joey@kodama.kitenet.net>
Mon, 4 Feb 2008 22:58:23 +0000 (17:58 -0500)
  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.

IkiWiki/Plugin/inline.pm
debian/changelog

index 796cf2cf6eb794b3ce59436d351987c3a595a672..ae3f8f409d81d9ba65bc680b60f0cb167a1ecc5c 100644 (file)
@@ -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{<link rel="alternate" type="application/rss+xml" title="RSS" href="$rssurl" />};
                }
-               if ($atom) {
+               if ($atom && ! $params{preview}) {
                        my $atomp=atompage($params{destpage}).$feednum;
                        will_render($params{destpage}, $atomp);
                        writefile($atomp, $config{destdir},
index a1100500f9c8013b58b79a3556bc59b450c0dabb..8220e162ba2af2170a5ad7aa025832b3754a7973 100644 (file)
@@ -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 <joeyh@debian.org>  Sat, 02 Feb 2008 23:36:31 -0500