Fix input_params upload handling, fix importxls.cgi for PgSQL/SQLite

hinted-selects
Vitaliy Filippov 2014-10-27 12:39:48 +03:00
parent c47f0a6935
commit a1a11fcfec
2 changed files with 8 additions and 2 deletions

View File

@ -487,7 +487,10 @@ sub input_params
{
if ($utf8)
{
utf8::decode($_) for @{$params->{$_}};
for (@{$params->{$_}})
{
utf8::decode($_) unless ref $_;
}
}
($params->{$_}) = @{$params->{$_}} if @{$params->{$_}} <= 1;
}

View File

@ -147,7 +147,10 @@ unless ($ARGS->{commit})
else
{
my $i = 0;
my $sth = $dbh->prepare("SELECT COUNT(*) FROM `bugs` WHERE `short_desc`=? AND `delta_ts`>=DATE_SUB(CURDATE(),INTERVAL ? DAY)");
my $sth = $dbh->prepare(
"SELECT COUNT(*) FROM bugs WHERE short_desc=? AND delta_ts >= ".
$dbh->sql_date_math('CURRENT_DATE', '-', '?', 'DAY')
);
for my $bug (@{$table->{data}})
{
# Check if this bug is already added