Skip to content

Commit edf69c8

Browse files
committed
Whitelist args list instead of blacklisting
1 parent 53e8c3c commit edf69c8

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/DB_Command.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,16 +1836,12 @@ protected function get_current_sql_modes( $assoc_args ) {
18361836

18371837
// Make sure the provided arguments don't interfere with the expected
18381838
// output here.
1839-
$args = $assoc_args;
1840-
unset(
1841-
$args['column-names'],
1842-
$args['result-format'],
1843-
$args['json'],
1844-
$args['html'],
1845-
$args['table'],
1846-
$args['tabbed'],
1847-
$args['vertical']
1848-
);
1839+
$args = [];
1840+
foreach ( [] as $arg ) {
1841+
if ( isset( $assoc_args[ $arg ] ) ) {
1842+
$args[ $arg ] = $assoc_args[ $arg ];
1843+
}
1844+
}
18491845

18501846
if ( null === $modes ) {
18511847
$modes = [];

0 commit comments

Comments
 (0)