]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* In the aggregator, check for and deal with post filenames that are
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 14 Jan 2007 04:17:53 +0000 (04:17 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 14 Jan 2007 04:17:53 +0000 (04:17 +0000)
  longer than the maximum file length.

IkiWiki/Plugin/aggregate.pm
debian/changelog

index 964ef4b4b282b829f5231f224e6ebfb9160e95eb..d11283f0a4fb113ccb5c444a44f727ab40d83eb3 100644 (file)
@@ -310,6 +310,20 @@ sub add_page (@) { #{{{
                       -e pagefile($page.$c)) {
                        $c++
                }
                       -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));
        }
                $guid->{page}=$page;
                debug(sprintf(gettext("creating new page %s"), $page));
        }
index 799c03245cc8c3f485b56b2252a3a68868f1c85d..64614e7272286f9b87cad10a8fd091fdd511d6fd 100644 (file)
@@ -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.
   * 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
 
 
 ikiwiki (1.38) unstable; urgency=low