From: Joey Hess Date: Mon, 2 Apr 2012 16:24:14 +0000 (-0400) Subject: passwordauth: Fix url in password recovery email to be absolute. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f9e96b0c32ea7db069c718020f65174ad0bcc1d7;p=ikiwiki.git passwordauth: Fix url in password recovery email to be absolute. This got broken when cgiurl began often returning a relative url. Added a cgiurl_abs for the things that need a guaranteed absolute cgiurl. --- diff --git a/IkiWiki.pm b/IkiWiki.pm index 2a83777e6..f68797ae3 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1092,6 +1092,11 @@ sub cgiurl (@) { join("&", map $_."=".uri_escape_utf8($params{$_}), keys %params); } +sub cgiurl_abs (@) { + eval q{use URI}; + URI->new_abs(cgiurl(@_), $config{cgiurl}); +} + sub baseurl (;$) { my $page=shift; diff --git a/IkiWiki/Plugin/notifyemail.pm b/IkiWiki/Plugin/notifyemail.pm index 58f0c9920..9f5a255ae 100644 --- a/IkiWiki/Plugin/notifyemail.pm +++ b/IkiWiki/Plugin/notifyemail.pm @@ -127,7 +127,7 @@ sub notify (@) { $template->param( wikiname => $config{wikiname}, url => $url, - prefsurl => $config{cgiurl}."?do=prefs", + prefsurl => IkiWiki::cgiurl_abs(do => 'prefs'), showcontent => $showcontent, content => $content, ); diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm index 6a5153efd..ac955dc50 100644 --- a/IkiWiki/Plugin/passwordauth.pm +++ b/IkiWiki/Plugin/passwordauth.pm @@ -296,7 +296,7 @@ sub formbuilder (@) { my $template=template("passwordmail.tmpl"); $template->param( user_name => $user_name, - passwordurl => IkiWiki::cgiurl( + passwordurl => IkiWiki::cgiurl_abs( 'do' => "reset", 'name' => $user_name, 'token' => $token, diff --git a/debian/changelog b/debian/changelog index ca1f92116..23c6dc5e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ ikiwiki (3.20120204) UNRELEASED; urgency=low the old hook name is called for now for back-compat. * meta: Support keywords header. Closes: #664780 Thanks, Martin Michlmayr + * passwordauth: Fix url in password recovery email to be absolute. -- Joey Hess Wed, 21 Mar 2012 14:33:14 -0400