1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Fix hitting backtrack limit in import (thanks to Tomas Votruba)

This commit is contained in:
Jakub Vrana
2012-12-15 22:07:42 -08:00
parent 0ac5a666b4
commit ab20c18c2e
2 changed files with 2 additions and 1 deletions

View File

@@ -171,7 +171,7 @@ if ($_POST && !$error) {
begin();
$separator = ($_POST["separator"] == "csv" ? "," : ($_POST["separator"] == "tsv" ? "\t" : ";"));
foreach ($matches[0] as $key => $val) {
preg_match_all("~((\"[^\"]*\")+|[^$separator]*)$separator~", $val . $separator, $matches2);
preg_match_all("~((?>\"[^\"]*\")+|[^$separator]*)$separator~", $val . $separator, $matches2);
if (!$key && !array_diff($matches2[1], $cols)) { //! doesn't work with column names containing ",\n
// first row corresponds to column names - use it for table structure
$cols = $matches2[1];