X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fcsvimporter.php;h=52fd2b56f407f579ceaca66afe9fc582836ef226;hb=5f6b3a28efe41c038f349fb0b281d9637f7078de;hp=6590df40976d86563d4ac976ebb49768354f91c8;hpb=756ff73fbb0cdd01cce2eda27ba18e1cc99bd735;p=platal.git diff --git a/classes/csvimporter.php b/classes/csvimporter.php index 6590df4..52fd2b5 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);