[wp-trac] [WordPress Trac] #16057: download_url() error checking fails to notice that the file wasnt correctly witten to disk

WordPress Trac noreply at wordpress.org
Fri Sep 6 03:41:55 UTC 2013


#16057: download_url() error checking fails to notice that the file wasnt correctly
witten to disk
-------------------------------------------------+-------------------------
 Reporter:  dd32                                 |       Owner:  dd32
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  3.7
Component:  HTTP                                 |     Version:  3.0
 Severity:  normal                               |  Resolution:
 Keywords:  3.3-early has-patch needs-testing    |
  commit                                         |
-------------------------------------------------+-------------------------
Changes (by dd32):

 * keywords:  3.3-early needs-refresh => 3.3-early has-patch needs-testing
     commit
 * component:  Upgrade/Install => HTTP


Comment:

 > Attachment attachment:16057.5.diff​ added

 This checks that `fwrite()` says that it successfully wrote the full block
 to the file - In the event that the disk is full, this *should* return the
 number of bytes written, which should be smaller than the full block
 size..

 This is untested (other than forcing the written block size to be
 smaller), but logically works based on php's behaviour, and seems like the
 correct behaviour for WP_HTTP.

 If anyone has an idea on how to fill a disk and reliably leave a few KB
 free for testing..

--
Ticket URL: <http://core.trac.wordpress.org/ticket/16057#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list