From: Jakub Vrana Date: Fri, 28 Feb 2025 13:40:31 +0000 (+0100) Subject: CSV import: Don't unquote " in unquoted values X-Git-Tag: v5.0.0~94 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=315ffc9d8bef1b29d866b5bf500d000d39e51e6c;p=adminer.git CSV import: Don't unquote " in unquoted values --- 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; }