X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/79d2d44db2acc4aeaf60de17d86951e1d7259e1d..a5de24ec9700c56f8945668c3647b45a7a9b71c2:/IkiWiki/Plugin/comments.pm?ds=inline diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 0ae9eefe3..1c10417c3 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -7,7 +7,7 @@ package IkiWiki::Plugin::comments; use warnings; use strict; -use IkiWiki 2.00; +use IkiWiki 3.00; use Encode; use POSIX qw(strftime); @@ -198,8 +198,17 @@ sub preprocess { $pagestate{$page}{meta}{author} = $params{claimedauthor}; } - if (defined $params{url} and safeurl($params{url})) { - $pagestate{$page}{meta}{authorurl} = $params{url}; + if (defined $params{url}) { + my $url=$params{url}; + + eval q{use URI::Heuristic}; + if (! $@) { + $url=URI::Heuristic::uf_uristr($url); + } + + if (safeurl($url)) { + $pagestate{$page}{meta}{authorurl} = $url; + } } } else { @@ -497,7 +506,10 @@ sub sessioncgi ($$) { error($conflict) if defined $conflict; # Jump to the new comment on the page. - IkiWiki::redirect($cgi, urlto($page, undef, 1)."#$location"); + # The trailing question mark tries to avoid broken + # caches and get the most recent version of the page. + IkiWiki::redirect($cgi, urlto($page, undef, 1)."#$location?updated"); + } else { IkiWiki::showform ($form, \@buttons, $session, $cgi,