OSDN Git Service

use escapeshellarg() instead of esc_cmd(), because the $editor variable can contain %s
authorscribu <mail@scribu.net>
Mon, 28 Oct 2013 19:55:41 +0000 (21:55 +0200)
committerscribu <mail@scribu.net>
Mon, 28 Oct 2013 19:55:43 +0000 (21:55 +0200)
see #822

php/utils.php

index 23f6d5e..d1713b5 100644 (file)
@@ -274,7 +274,7 @@ function launch_editor_for_input( $input, $title = 'WP-CLI' ) {
                        $editor = 'vi';
        }
 
-       \WP_CLI::launch( \WP_CLI\Utils\esc_cmd( "$editor %s", $tmpfile ) );
+       \WP_CLI::launch( "$editor " . escapeshellarg( $tmpfile ) );
 
        $output = file_get_contents( $tmpfile );