Commit d8e899ba authored by Frédéric Buclin's avatar Frédéric Buclin

Bug 561129: Various warnings thrown by Search.pm: Perl 5.12 complains for lc(undef) and uc(undef)

r/a=mkanat
parent 7ce9b17e
...@@ -398,8 +398,8 @@ sub init { ...@@ -398,8 +398,8 @@ sub init {
} }
} }
my $chfieldfrom = trim(lc($params->param('chfieldfrom'))) || ''; my $chfieldfrom = trim(lc($params->param('chfieldfrom') || ''));
my $chfieldto = trim(lc($params->param('chfieldto'))) || ''; my $chfieldto = trim(lc($params->param('chfieldto') || ''));
$chfieldfrom = '' if ($chfieldfrom eq 'now'); $chfieldfrom = '' if ($chfieldfrom eq 'now');
$chfieldto = '' if ($chfieldto eq 'now'); $chfieldto = '' if ($chfieldto eq 'now');
my @chfield = $params->param('chfield'); my @chfield = $params->param('chfield');
...@@ -1190,8 +1190,7 @@ sub BuildOrderBy { ...@@ -1190,8 +1190,7 @@ sub BuildOrderBy {
sub split_order_term { sub split_order_term {
my $fragment = shift; my $fragment = shift;
$fragment =~ /^(.+?)(?:\s+(ASC|DESC))?$/i; $fragment =~ /^(.+?)(?:\s+(ASC|DESC))?$/i;
my ($column_name, $direction) = (lc($1), uc($2)); my ($column_name, $direction) = (lc($1), uc($2 || ''));
$direction ||= "";
return wantarray ? ($column_name, $direction) : $column_name; return wantarray ? ($column_name, $direction) : $column_name;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment