aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Fripost/Schema/Misc.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Fripost/Schema/Misc.pm')
-rw-r--r--lib/Fripost/Schema/Misc.pm7
1 files changed, 4 insertions, 3 deletions
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;
}