[wp-trac] [WordPress Trac] #15013: [fix] Automatic plugin installer/updater fails to upload files over 64k (ftpext mode)

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 2 08:00:11 UTC 2010


#15013: [fix] Automatic plugin installer/updater fails to upload files over 64k
(ftpext mode)
-----------------------------+----------------------------------------------
 Reporter:  gasparch         |       Owner:                 
     Type:  defect (bug)     |      Status:  new            
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:  3.0.1          
 Severity:  normal           |    Keywords:                 
-----------------------------+----------------------------------------------
 In case if plugin/theme has a file which is larger than 64k - it fails to
 copy that file over FTP, sometimes leaving temp files exactly 65536 bytes
 long. FTP server itself has no problems copying such files (tested
 manually).

 It turns out that reading file in 8k chunks hits some bug in php randomly.
 So it works rarely, but msot of the time fails.
 Smaller buffer size works without any problems.

 So I've changed the
 wp-admin/includes/class-wp-filesystem-ftpext.php , line 107


         while ( ! feof($temp) )
             $contents .= fread($temp, 8192);

 to

         while ( ! feof($temp) )
             $contents .= fread($temp, 4096);

 and it started to work every time I use automatic updater/installer.

 CentOS 2.6.18-194.8.1.el5.028stab070.5 i686 athlon, Apache 2.0, PHP
 5.2.14, latest version of WordPress (3.0.1), pureftp.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15013>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list