diff options
author | Guilhem Moulin <guilhem.moulin@fripost.org> | 2013-01-26 21:54:51 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@fripost.org> | 2013-01-26 21:54:51 +0100 |
commit | 050f245fd22572f36de9339df800757018628449 (patch) | |
tree | 32aec5711c167011bdb4b4b81223dc57b4dd53d4 /lib/Fripost/Schema | |
parent | 5002c89470b511dea3bb8eb64c81a71b7788fa0f (diff) |
Fixed a bug with internationalization.
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); |