]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
note that the patch on this page is complely broken, and allows any file starting...
[git.ikiwiki.info.git] / IkiWiki.pm
index 00eadfd9818e6e41adc36457b6bb45361355817b..ee94ce659cbb5fdaffdf21da94fb50ae4e85c89f 100644 (file)
@@ -334,6 +334,15 @@ sub getsetup () {
                safe => 0, # paranoia
                rebuild => 0,
        },
+       include => {
+               type => "string",
+               default => undef,
+               example => '^\.htaccess$',
+               description => "regexp of normally ignored source files to include",
+               advanced => 1,
+               safe => 0, # regexp
+               rebuild => 1,
+       },
        exclude => {
                type => "string",
                default => undef,
@@ -1131,7 +1140,7 @@ sub openiduser ($) {
                # Convert "http://somehost.com/user" to "user [somehost.com]".
                # (also "https://somehost.com/user/")
                if ($display !~ /\[/) {
-                       $display=~s/^https?:\/\/(.+)\/([^\/]+)\/?$/$2 [$1]/;
+                       $display=~s/^https?:\/\/(.+)\/([^\/#?]+)\/?(?:[#?].*)?$/$2 [$1]/;
                }
                $display=~s!^https?://!!; # make sure this is removed
                eval q{use CGI 'escapeHTML'};
@@ -1820,6 +1829,10 @@ sub file_pruned ($;$) {
                $file =~ s#^\Q$base\E/+##;
        }
 
+       if (defined $config{include} && length $config{include}) {
+               return 0 if $file =~ m/$config{include}/;
+       }
+
        my $regexp='('.join('|', @{$config{wiki_file_prune_regexps}}).')';
        return $file =~ m/$regexp/;
 }