Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion features/media-import.feature
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ Feature: Manage WordPress attachments
my-image.png.png
"""
Scenario: Fail to import from STDIN when no input provided
When I try `wp media import - </dev/null`
When I run `php -r "file_put_contents('empty.txt', '');"`
And I try `wp media import - < empty.txt`
Then STDERR should contain:
"""
Warning: Unable to import file from STDIN. Reason: No input provided.
Expand Down
2 changes: 1 addition & 1 deletion src/Media_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ public function import( $args, $assoc_args = array() ) {
}

// Determine file extension from content
$mimetype = mime_content_type( $tempfile );
$mimetype = function_exists( 'mime_content_type' ) ? mime_content_type( $tempfile ) : '';

// Map MIME type to extension
$ext = '';
Expand Down