aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-12-31 20:50:22 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-12-31 20:50:22 +0000
commitc494e2f97461b5b524607cef88657e0bb89add25 (patch)
tree1180ad77ab9ad10b4cbbba61ed71e0af1368aeba /IkiWiki
parent552e1f852a3f578e4195c55a67a7cfb74524af65 (diff)
downloadikiwiki-c494e2f97461b5b524607cef88657e0bb89add25.tar
ikiwiki-c494e2f97461b5b524607cef88657e0bb89add25.tar.gz
* Escape shashes in page titles entered in the blog post form.
* Munge openids of the form somehost.com/user (trial, may revert)
Diffstat (limited to 'IkiWiki')
-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>";
}