X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fcsvimporter.php;h=7d56bc803e794b59dc65fb721c2d2c1246110ca1;hb=2e11cb87effddefdaed6da3e1951c935096ab361;hp=6590df40976d86563d4ac976ebb49768354f91c8;hpb=5f30b30e8b2657ade5c727e98de286386ee002d8;p=platal.git diff --git a/classes/csvimporter.php b/classes/csvimporter.php index 6590df4..7d56bc8 100644 --- a/classes/csvimporter.php +++ b/classes/csvimporter.php @@ -1,6 +1,6 @@ $ref) { - $ops[$key] = $this->getValue($line, $key, $ref); + $ops[$key] = $this->getValue($line, $key, $ref, $relation); } return $ops; } @@ -92,7 +92,7 @@ class CSVImporter { $ops = array(); foreach ($relation as $key=>$ref) { - $value = $this->getValue($line, $key, $ref); + $value = $this->getValue($line, $key, $ref, $relation); if (!is_null($value) && $value != 'NULL') { $value = "'" . addslashes($value) . "'"; } @@ -239,7 +239,7 @@ class CSVImporter } /** Handle insertion form - * @param $page PlatalPage to process + * @param $page PlPage to process * @param $url URI of the page * @param $field Editable fields */ @@ -330,6 +330,7 @@ class CSVImporter $fields[] = $key; } if ($current == 'valid' && Env::has('csv_valid')) { + S::assert_xsrf_token(); $this->run($_SESSION['csv_action'], $insert, $update); $page->assign('csv_done', true); $this->cleanSession($sesfields);