Fix invalid $cfg['Export']['format'] defaulting to sql in dropdown (fixes #19891)
When Export format is invalid (e.g. 'garbage'), the export page showed CodeGen selected instead of sql. Validate default against export plugin list and use 'sql' when invalid. Signed-off-by: Randy Yates <randyyates@gmail.com>
This commit is contained in:
parent
983fc7c2f6
commit
9fd7c26310
@ -132,6 +132,12 @@ final class Options
|
||||
}
|
||||
|
||||
$default = isset($_GET['what']) ? (string) $_GET['what'] : Plugins::getDefault('Export', 'format');
|
||||
$validNames = array_map(static function ($plugin) {
|
||||
return $plugin->getName();
|
||||
}, $exportList);
|
||||
if (! in_array($default, $validNames, true)) {
|
||||
$default = 'sql';
|
||||
}
|
||||
$dropdown = Plugins::getChoice($exportList, $default);
|
||||
$tableObject = new Table($table, $db);
|
||||
$rows = [];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user