Fix unlink warning. see #9936

git-svn-id: http://svn.automattic.com/wordpress/trunk@11465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-05-27 00:56:32 +00:00
parent fc523a990a
commit a4a448741e

View File

@ -631,10 +631,12 @@ function get_filesystem_method($args = array()) {
if( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){
$temp_file_name = ABSPATH . '.' . time();
$temp_handle = @fopen($temp_file_name, 'w');
if ( $temp_handle && getmyuid() == fileowner($temp_file_name) )
$method = 'direct';
@fclose($temp_handle);
unlink($temp_file_name);
if ( $temp_handle ) {
if ( getmyuid() == fileowner($temp_file_name) )
$method = 'direct';
@fclose($temp_handle);
unlink($temp_file_name);
}
}
if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') && extension_loaded('sockets') ) $method = 'ssh2';