aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-01-14 04:17:53 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-01-14 04:17:53 +0000
commit5608aa078e5a11ff6fbe1adda65a209017b0b630 (patch)
treea8230b0deb7e922c7890bf39f66fc130d9fe520f
parentb695d6bdec4bd673a7b43f717258a9922a284d4a (diff)
downloadikiwiki-5608aa078e5a11ff6fbe1adda65a209017b0b630.tar
ikiwiki-5608aa078e5a11ff6fbe1adda65a209017b0b630.tar.gz
* In the aggregator, check for and deal with post filenames that are
longer than the maximum file length.
-rw-r--r--IkiWiki/Plugin/aggregate.pm14
-rw-r--r--debian/changelog4
2 files changed, 17 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index 964ef4b4b..d11283f0a 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -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="item";
+ while (exists $IkiWiki::pagecase{lc $page.$c} ||
+ -e pagefile($page.$c)) {
+ $c++
+ }
+ }
+
$guid->{page}=$page;
debug(sprintf(gettext("creating new page %s"), $page));
}
diff --git a/debian/changelog b/debian/changelog
index 799c03245..64614e727 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,8 +14,10 @@ ikiwiki (1.39) UNRELEASED; urgency=low
* Search in default location for templates as a fallback when templatedir is
pointed elsewhere, so that only modified templates need to be copied into
a templatedir. Based on work by JeremyReed.
+ * In the aggregator, check for and deal with post filenames that are
+ longer than the maximum file length.
- -- Joey Hess <joeyh@debian.org> Sat, 13 Jan 2007 16:31:42 -0500
+ -- Joey Hess <joeyh@debian.org> Sat, 13 Jan 2007 23:03:48 -0500
ikiwiki (1.38) unstable; urgency=low