diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-03-08 06:03:59 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-03-08 06:03:59 +0000 |
commit | c1b698e4181002eeecdb5988ea767cae67a83a49 (patch) | |
tree | f5ed6d2a2269fe3bc6c696268b976a6d2b9871d5 /IkiWiki.pm | |
parent | 8430ee09e5702a63f6aee5876bda2f5edf1b8816 (diff) | |
download | ikiwiki-c1b698e4181002eeecdb5988ea767cae67a83a49.tar ikiwiki-c1b698e4181002eeecdb5988ea767cae67a83a49.tar.gz |
* The underscore escaping support exposed a bug in edit links: Such links
were titlepage escaped in the urls, and then doubly escaped by the CGI
when editing. To fix this, I removed the titlepage escaping in the edit
urls.
* That means that *every edit link* on the wiki is potentially changed.
Rebuilding wikis on upgrade to this version therefore necessary; enabled
that in postinst.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 0ed52aeae..85710c5ff 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -5,6 +5,7 @@ use warnings; use strict; use Encode; use HTML::Entities; +use URI::Escape; use open qw{:utf8 :std}; use vars qw{%config %links %oldlinks %oldpagemtime %pagectime %pagecase @@ -385,7 +386,8 @@ sub linkpage ($) { #{{{ sub cgiurl (@) { #{{{ my %params=@_; - return $config{cgiurl}."?".join("&", map "$_=$params{$_}", keys %params); + return $config{cgiurl}."?". + join("&", map $_."=".uri_escape($params{$_}), keys %params); } #}}} sub baseurl (;$) { #{{{ @@ -453,7 +455,11 @@ sub htmllink ($$$;@) { #{{{ if (! grep { $_ eq $bestlink } map { @{$_} } values %renderedfiles) { return $linktext unless length $config{cgiurl}; return "<span><a href=\"". - cgiurl(do => "create", page => lc($link), from => $page). + cgiurl( + do => "create", + page => pagetitle(lc($link), 1), + from => $page + ). "\">?</a>$linktext</span>" } |