X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/912521ef0711204965aa2319d41c7741bd3f4f4c..c494e2f97461b5b524607cef88657e0bb89add25:/IkiWiki/CGI.pm?ds=sidebyside diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 511358ff5..83ed959c0 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -419,6 +419,8 @@ sub cgi_editpage ($$) { #{{{ push @page_locs, $dir.$page; } } + push @page_locs, "$config{userdir}/$page" + if length $config{userdir}; @page_locs = grep { ! exists $pagecase{lc $_} && @@ -632,6 +634,7 @@ sub cgi (;$$) { #{{{ } elsif ($do eq 'blog') { my $page=titlepage(decode_utf8($q->param('title'))); + $page=~s/(\/)/"__".ord($1)."__"/eg; # escape slashes too # if the page already exists, munge it to be unique my $from=$q->param('from'); my $add=""; @@ -663,6 +666,10 @@ sub userlink ($) { #{{{ if ($display !~ /\[/) { $display=~s/^(.*?)\.([^.]+\.[a-z]+)$/$1 [$2]/; } + # Convert "somehost.com/user" to "user [somehost.com]". + if ($display !~ /\[/) { + $display=~s/^(.+)\/[^\/](.+)$/$2 [$1]/; + } $display=~s!^https?://!!; # make sure this is removed return "".escapeHTML($display).""; }