Fix unlink warning. see #9936

git-svn-id: https://develop.svn.wordpress.org/trunk@11465 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-05-27 00:56:32 +00:00
parent 22bf595381
commit c7767c9808
1 changed files with 6 additions and 4 deletions

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';