Skip to content

Commit 9faaad4

Browse files
committed
Fix export not working
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 8c6d3d8 commit 9faaad4

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

libraries/classes/Controllers/Export/ExportController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ public function __invoke(ServerRequest $request): void
122122

123123
$this->setGlobalsFromRequest($postParams);
124124

125-
$this->checkParameters(['what', 'export_type']);
126-
127125
// sanitize this parameter which will be used below in a file inclusion
128126
$GLOBALS['what'] = Core::securePath($whatParam);
129127

128+
$this->checkParameters(['what', 'export_type']);
129+
130130
// export class instance, not array of properties, as before
131131
$GLOBALS['export_plugin'] = Plugins::getPlugin('export', $GLOBALS['what'], [
132132
'export_type' => (string) $GLOBALS['export_type'],

test/classes/Controllers/Export/ExportControllerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ public function testExportController(): void
170170
$exportController = new ExportController(new ResponseRenderer(), new Template(), new Export($this->dbi));
171171
$exportController($request);
172172
$output = $this->getActualOutputForAssertion();
173+
174+
$this->assertStringNotContainsString('Missing parameter: what', $output);
175+
$this->assertStringNotContainsString('Missing parameter: export_type', $output);
173176
$this->assertStringContainsString(htmlspecialchars($expectedOutput), $output);
174177
}
175178
}

0 commit comments

Comments
 (0)