]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
sanitize nickname derived from email address
authorJoey Hess <joeyh@joeyh.name>
Thu, 14 May 2015 14:40:52 +0000 (10:40 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 14 May 2015 14:40:52 +0000 (10:40 -0400)
IkiWiki.pm

index 53eb8235bf85a6f7a419cec8206c397da10fdf06..dfdd0fe910556490d42a0faf67c8d6c4779ec15f 100644 (file)
@@ -1467,7 +1467,10 @@ sub openiduser ($) {
 sub emailuser ($) {
        my $user=shift;
        if (defined $user && $user =~ m/(.+)@/) {
 sub emailuser ($) {
        my $user=shift;
        if (defined $user && $user =~ m/(.+)@/) {
-               return $1;
+               my $nick=$1;
+               # remove any characters from not allowed in wiki files
+               $nick=~s/[^$config{wiki_file_chars}]/_/g;
+               return $nick;
        }
        return;
 }
        }
        return;
 }