Remove unnecessary stuff

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2024-03-14 15:43:58 +01:00
parent 548edd40c2
commit 5bfceae710

View File

@ -187,14 +187,7 @@ final class ImportController extends AbstractController
$this->response->addJSON('console_message_id', $consoleMessageId);
}
/**
* Sets globals from $_POST patterns, for import plugins
* We only need to load the selected plugin
*/
if (! in_array($format, ['csv', 'ldi', 'mediawiki', 'ods', 'shp', 'sql', 'xml'], true)) {
// this should not happen for a normal user
// but only during an attack
$this->response->setRequestStatus(false);
$this->response->addHTML(Message::error(__('Incorrect format parameter'))->getDisplay());
@ -202,12 +195,8 @@ final class ImportController extends AbstractController
}
$postPatterns = ['/^' . $format . '_/'];
Core::setPostAsGlobal($postPatterns);
// We don't want anything special in format
$format = Core::securePath($format);
if (Current::$table !== '' && Current::$database !== '') {
$GLOBALS['urlParams'] = ['db' => Current::$database, 'table' => Current::$table];
} elseif (Current::$database !== '') {