WordPress.org

Make WordPress Core

Ticket #9936: 9936.3.diff

File 9936.3.diff, 875 bytes (added by ryan, 11 years ago)
  • wp-admin/includes/file.php

     
    631631        if( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){
    632632                $temp_file_name = ABSPATH . '.' . time();
    633633                $temp_handle = @fopen($temp_file_name, 'w');
    634                 if ( $temp_handle && getmyuid() == fileowner($temp_file_name) )
    635                         $method = 'direct';
    636                 @fclose($temp_handle);
    637                 unlink($temp_file_name);
     634                if ( $temp_handle )
     635                        if ( getmyuid() == fileowner($temp_file_name) )
     636                                $method = 'direct';
     637                        @fclose($temp_handle);
     638                        unlink($temp_file_name);
     639                }
    638640        }
    639641
    640642        if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') && extension_loaded('sockets') ) $method = 'ssh2';