mirror of
https://github.com/vrana/adminer.git
synced 2025-08-14 02:23:59 +02:00
CSV import: Don't unquote " in unquoted values
This commit is contained in:
@@ -198,7 +198,7 @@ if ($_POST && !$error) {
|
|||||||
} else {
|
} else {
|
||||||
$set = array();
|
$set = array();
|
||||||
foreach ($matches2[1] as $i => $col) {
|
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;
|
$rows[] = $set;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user