X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/d0d598e429313756192927418757e2869004049e..733c7592b7f7103cc73dc563e827da2a0bab8674:/IkiWiki/Plugin/comments.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 0ae9eefe3..ddaa70732 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 {