Skip to content

Commit

Permalink
Item11501: Don't check the password
Browse files Browse the repository at this point in the history
No need to make sure passwords don't contain html markup - they are
never displayed.

git-svn-id: http://svn.foswiki.org/branches/Release01x01@13907 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Feb 4, 2012
1 parent 4b44aca commit 79ebf98
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/lib/Foswiki/UserMapping.pm
Original file line number Diff line number Diff line change
Expand Up @@ -556,16 +556,18 @@ sub validateRegistrationField {

#my ($this, $field, $value) = @_;

if ( $_[1] eq 'username'
# Filter username per the login validation rules.
if ( lc( $_[1] ) eq 'username'
&& !( $_[2] =~ m/$Foswiki::cfg{LoginNameFilterIn}/ ) )
{
throw Error::Simple("Invalid username");
}

unless ( $_[1] eq 'password' ) {
throw Error::Simple("Invalid $_[1]")
if ( $_[2] =~ m/[<>]+/ );
}
# Don't check contents of password - it's never displayed.
return $_[2] if ( lc( $_[1] ) eq 'password' || lc( $_[1] ) eq 'confirm' );

# Don't allow html markup in any other fields.
throw Error::Simple("Invalid $_[1]") if ( $_[2] =~ m/[<>]+/ );

return $_[2];
}
Expand Down

0 comments on commit 79ebf98

Please sign in to comment.