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:
parent
fc523a990a
commit
a4a448741e
|
@ -631,11 +631,13 @@ 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) )
|
||||
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';
|
||||
if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext';
|
||||
|
|
Loading…
Reference in New Issue