WordPress.org

Make WordPress Core

Ticket #16057: 16057.diff

File 16057.diff, 650 bytes (added by dd32, 4 years ago)
  • wp-admin/includes/file.php

     
    537537                return new WP_Error('http_404', trim($response['response']['message'])); 
    538538        } 
    539539 
    540         fwrite($handle, $response['body']); 
     540        $result = fwrite($handle, $response['body']); 
    541541        fclose($handle); 
    542542 
     543        if ( false === $result || is_int($result) && $result < strlen($response['body']) ) 
     544                return new WP_Error('http_cannot_write', __('Could not write to the temporary file. There may not be enough diskspace.') ); 
     545 
    543546        return $tmpfname; 
    544547} 
    545548