aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@fripost.org>2013-01-26 21:54:51 +0100
committerGuilhem Moulin <guilhem.moulin@fripost.org>2013-01-26 21:54:51 +0100
commit050f245fd22572f36de9339df800757018628449 (patch)
tree32aec5711c167011bdb4b4b81223dc57b4dd53d4
parent5002c89470b511dea3bb8eb64c81a71b7788fa0f (diff)
Fixed a bug with internationalization.
-rw-r--r--lib/Fripost/Panel/Interface.pm1
-rw-r--r--lib/Fripost/Panel/Login.pm3
-rw-r--r--lib/Fripost/Schema/Domain.pm9
-rw-r--r--lib/Fripost/Schema/Util.pm2
4 files changed, 9 insertions, 6 deletions
diff --git a/lib/Fripost/Panel/Interface.pm b/lib/Fripost/Panel/Interface.pm
index fc27158..228233e 100644
--- a/lib/Fripost/Panel/Interface.pm
+++ b/lib/Fripost/Panel/Interface.pm
@@ -603,6 +603,7 @@ sub parse_CGI_query {
$params{$_} = $rest{$_} for keys %rest;
foreach my $key (keys %params) {
+ Encode::_utf8_on($params{$key}) if defined $params{$key};
if ($key eq 'name') {
$entry->{$key} = $params{$key};
}
diff --git a/lib/Fripost/Panel/Login.pm b/lib/Fripost/Panel/Login.pm
index af40461..1eabafb 100644
--- a/lib/Fripost/Panel/Login.pm
+++ b/lib/Fripost/Panel/Login.pm
@@ -228,7 +228,8 @@ sub split_path {
$uri =~ s/^$script//s; # Strip the facing CGI script name
$uri =~ s/\?.*//s; # Strip the query
- map { decodeURIComponent($_); Encode::_utf8_on($_); $_ } (split '/', $uri);
+ map { my $x = decodeURIComponent($_); Encode::_utf8_on($x); $x }
+ (split '/', $uri);
}
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);