X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/80d16f80bf2e6a4edbef91d0f055e812537823d5..7f4825928325021a66e400c2e84bac9c52dd99f9:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index eb003a1fb..d64f4e688 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -141,6 +141,10 @@ sub checkconfig () { #{{{ require IkiWiki::Rcs::Stub; } + if (exists $config{umask}) { + umask(possibly_foolish_untaint($config{umask})); + } + run_hooks(checkconfig => sub { shift->() }); return 1; @@ -407,6 +411,7 @@ sub bestlink ($$) { #{{{ # absolute links $cwd=""; } + $link=~s/\/$//; do { my $l=$cwd; @@ -513,7 +518,9 @@ sub displaytime ($;$) { #{{{ sub beautify_url ($) { #{{{ my $url=shift; - $url =~ s!/index.$config{htmlext}$!/!; + if ($config{usedirs}) { + $url =~ s!/index.$config{htmlext}$!/!; + } $url =~ s!^$!./!; # Browsers don't like empty links... return $url; @@ -541,6 +548,7 @@ sub htmllink ($$$;@) { #{{{ my $page=shift; # the page that will contain the link (different for inline) my $link=shift; my %opts=@_; + $link=~s/\/$//; my $bestlink; @@ -560,7 +568,8 @@ sub htmllink ($$$;@) { #{{{ } return "$linktext" - if length $bestlink && $page eq $bestlink; + if length $bestlink && $page eq $bestlink && + ! defined $opts{anchor}; if (! $destsources{$bestlink}) { $bestlink=htmlpage($bestlink);