mirror of
https://github.com/vrana/adminer.git
synced 2025-08-11 17:14:07 +02:00
Fix long SQL query crash (bug #2839231)
Use ungreedy regular expressions git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@985 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -85,10 +85,10 @@ if ($_POST && !$error) {
|
||||
$file = preg_replace("~^\xEF\xBB\xBF~", '', $file); //! character set
|
||||
$cols = "";
|
||||
$rows = array(); //! packet size
|
||||
preg_match_all('~("[^"]*"|[^"\\n])+~', $file, $matches);
|
||||
preg_match_all('~("[^"]*"|[^"\\n])+~U', $file, $matches);
|
||||
foreach ($matches[0] as $key => $val) {
|
||||
$row = array();
|
||||
preg_match_all('~(("[^"]*")+|[^,]*),~', "$val,", $matches2);
|
||||
preg_match_all('~(("[^"]*")+|[^,]*),~U', "$val,", $matches2);
|
||||
if (!$key && !array_diff($matches2[1], array_keys($fields))) { //! doesn't work with column names containing ",\n
|
||||
// first row corresponds to column names - use it for table structure
|
||||
$cols = " (" . implode(", ", array_map('idf_escape', $matches2[1])) . ")";
|
||||
|
Reference in New Issue
Block a user