summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-07-04 16:44:38 -0400
committerJoey Hess <joey@kitenet.net>2010-07-04 16:44:38 -0400
commit7fdf1f1d007b5ef9a16f5c6d41200cadb25c1975 (patch)
tree1d6998d984c2468549d96bfa1cc631005e88e2ca /IkiWiki/Plugin
parente72ef3b070b18f4cb0a667be915266b27d7d3071 (diff)
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.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/git.pm2
-rw-r--r--IkiWiki/Plugin/openid.pm2
2 files changed, 2 insertions, 2 deletions
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);
}
}