From aa3340e58fc5b993bfc88070edf543a2ed82ef94 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Thu, 27 Sep 2012 03:32:46 +0200 Subject: Fixing unicode. --- lib/Fripost/Schema/Alias.pm | 2 +- lib/Fripost/Schema/Domain.pm | 2 +- lib/Fripost/Schema/List.pm | 6 +++--- lib/Fripost/Schema/Local.pm | 2 +- lib/Fripost/Schema/Mailbox.pm | 2 +- lib/Fripost/Schema/Misc.pm | 7 ++++--- 6 files changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/Fripost/Schema') diff --git a/lib/Fripost/Schema/Alias.pm b/lib/Fripost/Schema/Alias.pm index f111d7f..07ae84f 100644 --- a/lib/Fripost/Schema/Alias.pm +++ b/lib/Fripost/Schema/Alias.pm @@ -114,7 +114,7 @@ sub add { my ($l,$d) = split /\@/, email_to_ascii($a->{alias}), 2; die "Missing alias name\n" if $l eq ''; &_is_valid($a); - die "‘".$a->{alias}."‘ alread exists\n" + die "‘".$a->{alias}."’ already exists\n" if $self->local->exists($a->{alias},%options); my %attrs = ( objectClass => 'FripostVirtualAlias' diff --git a/lib/Fripost/Schema/Domain.pm b/lib/Fripost/Schema/Domain.pm index 8017e00..64a8932 100644 --- a/lib/Fripost/Schema/Domain.pm +++ b/lib/Fripost/Schema/Domain.pm @@ -94,7 +94,7 @@ sub get { my $domain = $domains->pop_entry; unless (defined $domain) { die $options{'-die'}."\n" if defined $options{'-die'}; - die "No such such domain ‘$d‘.\n"; + die "No such such domain: ‘$d’\n"; } return ( domain => domain_to_unicode($domain->get_value('fvd')) diff --git a/lib/Fripost/Schema/List.pm b/lib/Fripost/Schema/List.pm index edf9d24..87876f6 100644 --- a/lib/Fripost/Schema/List.pm +++ b/lib/Fripost/Schema/List.pm @@ -117,7 +117,7 @@ sub add { die "Missing list name\n" if $l eq ''; must_attrs( $l, 'transport' ); &_is_valid($l); - die "‘".$l->{list}."‘ already exists\n" + die "‘".$l->{list}."’ already exists\n" if $self->local->exists($l->{list},%options); my %attrs = ( objectClass => 'FripostVirtualList' @@ -177,7 +177,7 @@ sub is_pending { scope => 'base', deref => 'never', filter => 'objectClass=FripostVirtualList', - attrs => [ 'fvl', 'fripostIsStatusPending' ] + attrs => [ 'fripostIsStatusPending' ] ); die "Error: ".$l.'@'.$d.": No such object in the LDAP directory\n" if $mesg->code == 32; # No such object; a common error here. @@ -265,7 +265,7 @@ sub _is_valid { must_attrs( $l, qw/list isactive/ ); $l->{list} = email_valid( $l->{list}, -exact => 1 ); - die "Invalid transport: ‘".$l->{transport}."‘\n" + die "Invalid transport: ‘".$l->{transport}."’\n" if defined $l->{transport} and $l->{transport} !~ /^(schleuder|mailman)$/; # TODO: check commands diff --git a/lib/Fripost/Schema/Local.pm b/lib/Fripost/Schema/Local.pm index bf92555..9efff91 100644 --- a/lib/Fripost/Schema/Local.pm +++ b/lib/Fripost/Schema/Local.pm @@ -68,7 +68,7 @@ sub get { unless (defined $local) { die $options{'-die'}."\n" if defined $options{'-die'}; - die "No such such entry ‘".$loc."‘.\n"; + die "No such such entry ‘".$loc."’.\n"; } my %ret; diff --git a/lib/Fripost/Schema/Mailbox.pm b/lib/Fripost/Schema/Mailbox.pm index 0f2ff53..95e2d10 100644 --- a/lib/Fripost/Schema/Mailbox.pm +++ b/lib/Fripost/Schema/Mailbox.pm @@ -137,7 +137,7 @@ sub add { my ($l,$d) = split /\@/, email_to_ascii($m->{user}), 2; die "Missing user name\n" if $l eq ''; &_is_valid($m); - die "‘".$m->{user}."‘ alread exists\n" + die "‘".$m->{user}."’ already exists\n" if $self->local->exists($m->{user},%options); my %attrs = ( objectClass => 'FripostVirtualMailbox' diff --git a/lib/Fripost/Schema/Misc.pm b/lib/Fripost/Schema/Misc.pm index 745a20b..114e01b 100644 --- a/lib/Fripost/Schema/Misc.pm +++ b/lib/Fripost/Schema/Misc.pm @@ -82,7 +82,7 @@ sub get_perms { sub must_attrs { my $h = shift; foreach (@_) { - die '‘'.$_."‘: Missing attribute.\n" + die 'Missing attribute: ‘'.$_."’\n" unless defined $h->{$_} and (ref $h->{$_} eq 'ARRAY' ? @{$h->{$_}} : $h->{$_} ne '') } @@ -102,14 +102,15 @@ sub email_valid { my $mesg = $options{'-error'} // "Invalid e-mail"; $in = $options{'-prefix'}.$i if defined $options{'-prefix'}; Encode::_utf8_on($in); + Encode::_utf8_on($i); $in = Net::IDN::Encode::email_to_ascii($in); my $addr = Email::Valid::->address( -address => $in, -tldcheck => 1, -fqdn => 1 ); my $match = defined $addr; - $match &&= $addr eq $in if $options{'-exact'}; - die $mesg." ‘".$i."‘\n" unless $match; + $match &&= $addr eq $in if $options{'-exact'}; + die $mesg." ‘".$i."’\n" unless $match; $addr =~ s/^$options{'-prefix'}// if defined $options{'-prefix'}; return $addr; } -- cgit v1.2.3