﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
17120,Class WP_Importer references STDIN which is not available in Web Environments,dd32,,"STDERR is not defined in web environments (only certain CLI environments), you can call fopen('php://stderr'); directly, however this is not delivered to browsers.

Since this is in the Multisite code, CLI imports might be more common, but it's not a given that multisite imports will not be run from the web either.

Code ref:
http://core.trac.wordpress.org/browser/trunk/wp-admin/includes/class-wp-importer.php#L128
{{{
126	                        $blog = 'http://' . preg_replace( '#^https?://#', '', $blog_id );
127	                        if ( ( !$parsed = parse_url( $blog ) ) || empty( $parsed['host'] ) ) {
128	                                fwrite( STDERR, ""Error: can not determine blog_id from $blog_id\n"" );
129	                                exit();
130	                        }
131	                        if ( empty( $parsed['path'] ) )
132	                                $parsed['path'] = '/';
133	                        $blog = get_blog_details( array( 'domain' => $parsed['host'], 'path' => $parsed['path'] ) );
134	                        if ( !$blog ) {
135	                                fwrite( STDERR, ""Error: Could not find blog\n"" );
136	                                exit();
137	                        }
}}}

I'm unsure of the best way to tackle this, Ideally in a CLI environment we want the error outputs going to STDERR, but since that's not available or visible to web browsers, wp_die() would be a better choice.

One potential method would be to direct wp_die() to STDERR in CLI environments - That might cause problems with the test suite however (I'm unsure)",defect (bug),new,low,Future Release,Import,3.0,minor,,needs-patch,
