aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/CGI.pm
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/CGI.pm')
-rw-r--r--IkiWiki/CGI.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm
index 7f84f345a..83ed959c0 100644
--- a/IkiWiki/CGI.pm
+++ b/IkiWiki/CGI.pm
@@ -634,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="";
@@ -665,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 "<a href=\"$user\">".escapeHTML($display)."</a>";
}