X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/c4d4cad3befbbd444d094cbeb0b6ebba3910a025..bd48ff734a0e01a6f2c097932f728ccb680702a2:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 6fd112960..66ae86809 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1769,12 +1769,14 @@ sub template_depends ($$;@) { my $page=shift; my ($filename, $tpage, $untrusted)=template_file($name); + if (! defined $filename) { + error(sprintf(gettext("template %s not found"), $name)) + } + if (defined $page && defined $tpage) { add_depends($page, $tpage); } - - return unless defined $filename; - + my @opts=( filter => sub { my $text_ref = shift; @@ -2401,14 +2403,17 @@ package IkiWiki::PageSpec; sub derel ($$) { my $path=shift; my $from=shift; - if ($path eq '.') { - $path = $from; - } - if ($path =~ m!^\./!) { - $from=~s#/?[^/]+$## if defined $from; - $path=~s#^\./##; - $path="$from/$path" if defined $from && length $from; + if ($path =~ m!^\.(/|$)!) { + if ($1) { + $from=~s#/?[^/]+$## if defined $from; + $path=~s#^\./##; + $path="$from/$path" if defined $from && length $from; + } + else { + $path = $from; + $path = "" unless defined $path; + } } return $path;