Skip to content

Commit

Permalink
Simplify sanitize_mysql_command() call that extends the real mysql co…
Browse files Browse the repository at this point in the history
…mmand

Just directly call readlink() which returns the full path regardless if it's
a symlink or a regular binary.

Signed-off-by: Donatas Abraitis <[email protected]>
  • Loading branch information
ton31337 committed Nov 10, 2024
1 parent b35ba84 commit 7a6d128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DB_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ protected function get_current_sql_modes( $assoc_args ) {
*/
private static function sanitize_mysql_command( $command, $default_flags ) {
return sprintf(
'/usr/bin/env $(test -L $(command -v %s) && /usr/bin/readlink -f $(command -v %s) || command -v %s)%s',
'/usr/bin/env $(/usr/bin/readlink -f $(command -v %s)%s',
$command,
$command,
$command,
Expand Down

0 comments on commit 7a6d128

Please sign in to comment.