]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/aggregate.pm
* Generalised preprocesser loop protection code.
[git.ikiwiki.info.git] / IkiWiki / Plugin / aggregate.pm
index 41c25fe26d03f3d1689dedcbedb7db2afb59d250..33d7174f5367a394846462080bd0786840e33ad0 100644 (file)
@@ -35,12 +35,14 @@ sub getopt () { #{{{
 } #}}}
 
 sub checkconfig () { #{{{
 } #}}}
 
 sub checkconfig () { #{{{
+       IkiWiki::lockwiki();
        loadstate();
        if ($IkiWiki::config{aggregate}) {
                IkiWiki::loadindex();
                aggregate();
                savestate();
        }
        loadstate();
        if ($IkiWiki::config{aggregate}) {
                IkiWiki::loadindex();
                aggregate();
                savestate();
        }
+       IkiWiki::unlockwiki();
 } #}}}
 
 sub filter (@) { #{{{
 } #}}}
 
 sub filter (@) { #{{{
@@ -98,7 +100,7 @@ sub preprocess (@) { #{{{
 
        return "<a href=\"".$feed->{url}."\">".$feed->{name}."</a>: ".
               "<i>".$feed->{message}."</i> (".$feed->{numposts}.
 
        return "<a href=\"".$feed->{url}."\">".$feed->{name}."</a>: ".
               "<i>".$feed->{message}."</i> (".$feed->{numposts}.
-              " stored posts; ".$feed->{newposts}." new)<br />";
+              " stored posts; ".$feed->{newposts}." new)";
 } # }}}
 
 sub delete (@) { #{{{
 } # }}}
 
 sub delete (@) { #{{{
@@ -260,13 +262,12 @@ sub add_page (@) { #{{{
                # directory name or trigger ".." disallowing code.
                $page=~s!([/.])!"__".ord($1)."__"!eg;
                $page=$feed->{dir}."/".$page;
                # directory name or trigger ".." disallowing code.
                $page=~s!([/.])!"__".ord($1)."__"!eg;
                $page=$feed->{dir}."/".$page;
-               $page=lc($page);
                ($page)=$page=~/$IkiWiki::config{wiki_file_regexp}/;
                if (! defined $page || ! length $page) {
                        $page=$feed->{dir}."/item";
                }
                my $c="";
                ($page)=$page=~/$IkiWiki::config{wiki_file_regexp}/;
                if (! defined $page || ! length $page) {
                        $page=$feed->{dir}."/item";
                }
                my $c="";
-               while (exists $IkiWiki::pagesources{$page.$c} ||
+               while (exists $IkiWiki::pagecase{lc $page.$c} ||
                       -e pagefile($page.$c)) {
                        $c++
                }
                       -e pagefile($page.$c)) {
                        $c++
                }