Pasting a username with too much space in results in a 500 error.. Make it DTRT instead
Tomas Doran [Wed, 15 Jul 2009 10:06:01 +0000 (10:06 +0000)]
lib/Catalyst/Authentication/Store/LDAP/Backend.pm

index 5ae20ce..39b3780 100644 (file)
@@ -276,6 +276,8 @@ sub lookup_user {
     if ( $id =~ /\*/ ) {
         Catalyst::Exception->throw("ID $id contains wildcards!");
     }
+    # Trim trailing space or we confuse ourselves
+    $id =~ s/\s+$//;
     my $ldap = $self->ldap_bind;
     my @searchopts;
     if ( defined( $self->user_basedn ) ) {