mirror of
https://github.com/vrana/adminer.git
synced 2025-08-09 16:17:48 +02:00
Quote values with leading and trailing zeroes in CSV export (bug #777)
This commit is contained in:
@@ -1129,7 +1129,7 @@ function dump_headers($identifier, $multi_table = false) {
|
||||
*/
|
||||
function dump_csv($row) {
|
||||
foreach ($row as $key => $val) {
|
||||
if (preg_match("~[\"\n,;\t]~", $val) || $val === "") {
|
||||
if (preg_match('~["\n,;\t]|^0|\.\d*0$~', $val) || $val === "") {
|
||||
$row[$key] = '"' . str_replace('"', '""', $val) . '"';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user