1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 22:56:46 +02:00

CSV import: Don't unquote " in unquoted values

This commit is contained in:
Jakub Vrana
2025-02-28 14:40:31 +01:00
parent 530b3dd1e5
commit 315ffc9d8b

View File

@@ -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;
}