1 Preliminary patch for a feature wishlist item: [[bugs/pruning_is_too_strict]].
3 diff -ur ikiwiki-orig/IkiWiki/CGI.pm ikiwiki/IkiWiki/CGI.pm
4 --- ikiwiki-orig/IkiWiki/CGI.pm 2006-10-27 20:15:17.000000000 -0700
5 +++ ikiwiki/IkiWiki/CGI.pm 2006-11-07 22:32:41.000000000 -0800
7 my ($page)=$form->field('page');
8 $page=titlepage(possibly_foolish_untaint($page));
9 if (! defined $page || ! length $page ||
10 - $page=~/$config{wiki_file_prune_regexp}/ || $page=~/^\//) {
11 + is_prune($page) || $page=~/^\//) {
12 error("bad page name");
17 if (! defined $from || ! length $from ||
18 $from ne $form->field('from') ||
19 - $from=~/$config{wiki_file_prune_regexp}/ ||
21 + is_prune($from) || $from=~/^\// ||
22 $form->submitted eq "Preview") {
23 @page_locs=$best_loc=$page;
25 diff -ur ikiwiki-orig/IkiWiki/Render.pm ikiwiki/IkiWiki/Render.pm
26 --- ikiwiki-orig/IkiWiki/Render.pm 2006-10-27 20:15:17.000000000 -0700
27 +++ ikiwiki/IkiWiki/Render.pm 2006-11-07 22:36:48.000000000 -0800
32 - if (/$config{wiki_file_prune_regexp}/) {
36 elsif (! -d $_ && ! -l $_) {
41 - if (/$config{wiki_file_prune_regexp}/) {
42 + if (is_prune($_, $config{underlaydir})) {
45 elsif (! -d $_ && ! -l $_) {
46 diff -ur ikiwiki-orig/IkiWiki.pm ikiwiki/IkiWiki.pm
47 --- ikiwiki-orig/IkiWiki.pm 2006-10-27 20:15:23.000000000 -0700
48 +++ ikiwiki/IkiWiki.pm 2006-11-07 22:21:17.000000000 -0800
55 memoize("pagespec_translate");
57 my $installdir=''; # INSTALLDIR_AUTOREPLACE done by Makefile, DNE
62 +sub basefile ($;$) { #{{{
64 + my $base=shift || $config{srcdir};
67 + $base=File::Spec->canonpath($base);
68 + my $ret=File::Spec->canonpath($file);
74 +sub is_prune ($;$) { #{{{
75 + return basefile($_[0], $_[1])=~m/$config{wiki_file_prune_regexp}/;
78 sub abs2rel ($$) { #{{{
79 # Work around very innefficient behavior in File::Spec if abs2rel
80 # is passed two relative paths. It's much faster if paths are