From 315ffc9d8bef1b29d866b5bf500d000d39e51e6c Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 28 Feb 2025 14:40:31 +0100 Subject: [PATCH] CSV import: Don't unquote " in unquoted values --- adminer/select.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 59dda234..9c5dec8e 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -198,7 +198,7 @@ if ($_POST && !$error) { } else { $set = array(); foreach ($matches2[1] as $i => $col) { - $set[idf_escape($cols[$i])] = ($col == "" && $fields[$cols[$i]]["null"] ? "NULL" : q(str_replace('""', '"', preg_replace('~^"|"$~', '', $col)))); + $set[idf_escape($cols[$i])] = ($col == "" && $fields[$cols[$i]]["null"] ? "NULL" : q(preg_match('~^".*"$~s', $col) ? str_replace('""', '"', substr($col, 1, -1)) : $col)); } $rows[] = $set; }