X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fcsvimporter.php;h=6acb2c73b0203b763fed73000d9b8f7760e974e0;hb=c80c472d71d62a56289b6d0c29a00be9cdcd4389;hp=6590df40976d86563d4ac976ebb49768354f91c8;hpb=ebd515f95f03f8a87f9b846d65e179b39a535222;p=platal.git diff --git a/classes/csvimporter.php b/classes/csvimporter.php index 6590df4..6acb2c7 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,11 +239,11 @@ 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 */ - public function apply(&$page, $url, $fields = null) + public function apply($page, $url, $fields = null) { $sesfields = array('csv_value', 'csv_user_value', 'csv_cond_field', 'csv_update', 'csv_action', 'csv_cond_field', @@ -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);