diff options
Diffstat (limited to 'lib/Fripost/Schema')
-rw-r--r-- | lib/Fripost/Schema/Domain.pm | 9 | ||||
-rw-r--r-- | lib/Fripost/Schema/Util.pm | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/Fripost/Schema/Domain.pm b/lib/Fripost/Schema/Domain.pm index 950484b..6ed22b6 100644 --- a/lib/Fripost/Schema/Domain.pm +++ b/lib/Fripost/Schema/Domain.pm @@ -181,9 +181,10 @@ sub search { my @filters = ('objectClass=FripostVirtualDomain'); if ($domainname) { - $domainname = Net::LDAP::Util::escape_filter_value($domainname) + my $d = domain_to_ascii($domainname); + $d = Net::LDAP::Util::escape_filter_value($d) unless $options{'-no-escape'}; - push @filters, 'fvd='.$domainname; + push @filters, 'fvd='.$d; } if (defined $options{'-filter'}) { @@ -625,7 +626,7 @@ B<Fripost::Schema::Util> for details. sub unlock { my $self = shift; - my $domainname = shift; + my $domainname = domain_to_ascii(shift); my $token = shift; my %options = @_; @@ -699,7 +700,7 @@ sub _is_valid { my %options = @_; eval { Fripost::Schema::Util::must_attrs( $d, qw/name isActive/ ); - $d->{name} = domain_valid( $d->{name} ); + $d->{name} = domain_valid( domain_to_ascii ($d->{name}) ); $d->{catchAll} = [ map { email_valid($_, -prefix => 'fake') } @{$d->{catchAll}} ] if $d->{catchAll}; diff --git a/lib/Fripost/Schema/Util.pm b/lib/Fripost/Schema/Util.pm index 2d1a60f..d5e122e 100644 --- a/lib/Fripost/Schema/Util.pm +++ b/lib/Fripost/Schema/Util.pm @@ -164,7 +164,7 @@ sub split_addr { my $e = $options{'-encode'}; if ($e eq 'ascii') { Encode::_utf8_on($d); - $addr = Net::IDN::Encode::domain_to_ascii($d); + $d = Net::IDN::Encode::domain_to_ascii($d); } elsif ($e eq 'unicode') { $d = Net::IDN::Encode::domain_to_unicode($d); |