From: Joey Hess Date: Sun, 4 Jul 2010 20:44:38 +0000 (-0400) Subject: move nickname sanitization out X-Git-Tag: 3.20100704~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7fdf1f1d007b5ef9a16f5c6d41200cadb25c1975;p=ikiwiki.git move nickname sanitization out Probably best to store it unsanitized and sanitize as needed on use. And it already was for comments, leaving only the need to sanitize the nickname when git committing, to ensure the email address is legal. --- diff --git a/IkiWiki/Plugin/git.pm b/IkiWiki/Plugin/git.pm index 0f92476c9..cb3437e18 100644 --- a/IkiWiki/Plugin/git.pm +++ b/IkiWiki/Plugin/git.pm @@ -517,6 +517,8 @@ sub rcs_commit_staged (@) { } if (defined $params{session}->param("nickname")) { $u=encode_utf8($params{session}->param("nickname")); + $u=~s/\s+/_/g; + $u=~s/[^-_0-9[:alnum:]]+//g; } if (defined $u) { $ENV{GIT_AUTHOR_EMAIL}="$u\@web"; diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 4727577f3..b1a9a7a15 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -211,8 +211,6 @@ sub auth ($$) { } } if (defined $nickname) { - $nickname=~s/\s+/_/g; - $nickname=~s/[^-_0-9[:alnum:]]+//g; $session->param(nickname => $nickname); } }