X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fcsvimporter.php;h=52fd2b56f407f579ceaca66afe9fc582836ef226;hb=9007d4955f2487e82c0f9f4059e1f6b450bdb528;hp=6590df40976d86563d4ac976ebb49768354f91c8;hpb=d0327f6de73e81c4bcc656471ca4161e4f1e1e1b;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);