Skip to content

Commit

Permalink
Whitelist args list instead of blacklisting
Browse files Browse the repository at this point in the history
  • Loading branch information
schlessera committed Apr 18, 2020
1 parent db6ec41 commit 2f031ba
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/DB_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -1836,16 +1836,12 @@ protected function get_current_sql_modes( $assoc_args ) {

// Make sure the provided arguments don't interfere with the expected
// output here.
$args = $assoc_args;
unset(
$args['column-names'],
$args['result-format'],
$args['json'],
$args['html'],
$args['table'],
$args['tabbed'],
$args['vertical']
);
$args = [];
foreach ( [] as $arg ) {
if ( isset( $assoc_args[ $arg ] ) ) {
$args[ $arg ] = $assoc_args[ $arg ];
}
}

if ( null === $modes ) {
$modes = [];
Expand Down

0 comments on commit 2f031ba

Please sign in to comment.