]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
close merged bugs
[ikiwiki.git] / IkiWiki.pm
index d93ff7374069684a97e35c5626ec853e02d4ce47..6747a3ba45b7bf11bfec18319f85c7963a82c7c9 100644 (file)
@@ -100,7 +100,7 @@ sub getsetup () {
                type => "string",
                default => '',
                example => "/var/www/wiki/ikiwiki.cgi",
-               description => "cgi wrapper to generate",
+               description => "filename of cgi wrapper to generate",
                safe => 0, # file
                rebuild => 0,
        },
@@ -949,16 +949,16 @@ sub formattime ($;$) {
 sub beautify_urlpath ($) {
        my $url=shift;
 
-       if ($config{usedirs}) {
-               $url =~ s!/index.$config{htmlext}$!/!;
-       }
-
        # Ensure url is not an empty link, and if necessary,
        # add ./ to avoid colon confusion.
-       if ($url !~ /^\// && $url !~ /^\.\.\//) {
+       if ($url !~ /^\// && $url !~ /^\.\.?\//) {
                $url="./$url";
        }
 
+       if ($config{usedirs}) {
+               $url =~ s!/index.$config{htmlext}$!/!;
+       }
+
        return $url;
 }
 
@@ -1797,7 +1797,8 @@ sub pagespec_match ($$;@) {
        }
 
        my $sub=pagespec_translate($spec);
-       return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"") if $@;
+       return IkiWiki::FailReason->new("syntax error in pagespec \"$spec\"")
+               if $@ || ! defined $sub;
        return $sub->($page, @params);
 }