]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
hack to avoid globlist deprecaton message false positive
[ikiwiki.git] / IkiWiki.pm
index 2a3a84d9ae3586c529ae8e347f6c26107b15a413..cc1e89acc04db45f18cb90a40e7a2a538b4350f4 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;
 }
 
@@ -1624,7 +1624,10 @@ sub globlist_to_pagespec ($) {
 
 sub is_globlist ($) {
        my $s=shift;
-       return ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
+       my $ret= ( $s =~ /[^\s]+\s+([^\s]+)/ && $1 ne "and" && $1 ne "or" );
+       print STDERR "warning: deprecated GlobList style PageSpec \"$s\" will stop working in ikiwiki version 3.0\n"
+               if $ret && $s !~ /TMPL_VAR/; # hack alert
+       return $ret;
 }
 
 sub safequote ($) {