From a1a11fcfec9c75e35647fed788d6d507cf0e666e Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Mon, 27 Oct 2014 12:39:48 +0300 Subject: [PATCH] Fix input_params upload handling, fix importxls.cgi for PgSQL/SQLite --- Bugzilla.pm | 5 ++++- importxls.cgi | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Bugzilla.pm b/Bugzilla.pm index ea3e82cfb..f04fefffa 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -487,7 +487,10 @@ sub input_params { if ($utf8) { - utf8::decode($_) for @{$params->{$_}}; + for (@{$params->{$_}}) + { + utf8::decode($_) unless ref $_; + } } ($params->{$_}) = @{$params->{$_}} if @{$params->{$_}} <= 1; } diff --git a/importxls.cgi b/importxls.cgi index d780dbc42..013a51926 100755 --- a/importxls.cgi +++ b/importxls.cgi @@ -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