[wp-trac] [WordPress Trac] #20074: Attempt MD5 checksum verification in upgrader if available

WordPress Trac wp-trac at lists.automattic.com
Wed Mar 7 22:32:17 UTC 2012


#20074: Attempt MD5 checksum verification in upgrader if available
------------------------------------+------------------
 Reporter:  sivel                   |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  3.4
Component:  Upgrade/Install         |     Version:  2.8
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |
------------------------------------+------------------

Comment (by sivel):

 Replying to [comment:7 westi]:
 > [attachment:20074.2.diff] is my preferred of the later two patches but
 I'm not a big fan of extending download_url to optionally return the HTTP
 Repsonse object.
 >
 > The whole point of the function is you either get a temp filename where
 the file has been downloaded to or an Error object adding a third thing
 into the mix complicates things for the users of the function
 unnecessarily - I think if you want access to the full HTTP response
 object you should make your own version of the function.

 We actually had to do this with
 [https://github.com/rmccue/wpqi/blob/master/file.php#L53 wpqi] but I don't
 really see why we couldn't return the response.  If it is more palatable
 we could assign the $response by reference like nacin mentioned.

 > Also the current patch leaves files lying around because it is the
 responsibility of the caller of download_url to unlink but if the funtion
 returns the full response you don't have access to the temp file to
 unlink.

 The HTTP response will return the filename regardless if it was provided
 to the HTTP API or if the HTTP API generated the temp name.

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


More information about the wp-trac mailing list