File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -945,9 +945,10 @@ public function version( $args = [], $assoc_args = [] ) {
945945 foreach ( $ assoc_args as $ key => $ value ) {
946946 if ( 'actual ' !== $ key ) {
947947 if ( true === $ value ) {
948- $ cmd_args [] = " -- { $ key}" ;
948+ $ cmd_args [] = ' -- ' . $ key ;
949949 } elseif ( is_string ( $ value ) ) {
950- $ cmd_args [] = "-- {$ key }= {$ value }" ;
950+ // Escape the value to prevent command injection
951+ $ cmd_args [] = '-- ' . $ key . '= ' . escapeshellarg ( $ value );
951952 }
952953 }
953954 }
@@ -992,7 +993,7 @@ public function version( $args = [], $assoc_args = [] ) {
992993 * @when after_wp_load
993994 *
994995 * @param string[] $args Positional arguments. Unused.
995- * @param array $assoc_args Associative arguments passed through from version command.
996+ * @param array{extra?: bool} $assoc_args Associative arguments passed through from version command.
996997 */
997998 public function version_db_actual ( $ args = [], $ assoc_args = [] ) {
998999 $ details = self ::get_wp_details ();
You can’t perform that action at this time.
0 commit comments