X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f94e1dc11bff782bfc9ebf5247ded9ec8175518b..29e6ff03b078a0c6abb659c9e81343d523d3b13a:/IkiWiki/Plugin/aggregate.pm diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 964ef4b4b..7fceb0df3 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -270,7 +270,7 @@ sub aggregate () { #{{{ ); } - $feed->{message}=sprintf(gettext("processed ok at "), + $feed->{message}=sprintf(gettext("processed ok at %s"), displaytime($feed->{lastupdate})); $feed->{error}=0; } @@ -310,6 +310,20 @@ sub add_page (@) { #{{{ -e pagefile($page.$c)) { $c++ } + + # Make sure that the file name isn't too long. + # NB: This doesn't check for path length limits. + eval q{use POSIX}; + my $max=POSIX::pathconf($config{srcdir}, &POSIX::_PC_NAME_MAX); + if (defined $max && length(htmlpage($page)) >= $max) { + $c=""; + $page=$feed->{dir}."/item"; + while (exists $IkiWiki::pagecase{lc $page.$c} || + -e pagefile($page.$c)) { + $c++ + } + } + $guid->{page}=$page; debug(sprintf(gettext("creating new page %s"), $page)); }