Make WordPress Core

Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#15013 closed defect (bug) (invalid)

[fix] Automatic plugin installer/updater fails to upload files over 64k (ftpext mode)

Reported by: gasparch Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Upgrade/Install Keywords:
Focuses: Cc:


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);


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.

Change History (7)

comment:1 in reply to: ↑ description @nacin5 years ago

Replying to gasparch:

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.

Any documentation on this or any reports upstream?

comment:2 @aldenta5 years ago

  • Cc ford@… added

comment:3 @dd325 years ago

  • Keywords 3.2-early added
  • Milestone changed from Awaiting Review to Future Release

comment:4 @dd325 years ago

Seems like an utterly useless change to me.

That being said, PureFTP seems to have issues with a lot of things, While the change is useless, it also won't kill something.. So even for throwing it in there to be s safe s possible is an option.

comment:5 @wonderboymusic3 years ago

  • Keywords close added

Unless dd32 jumps on this, suggesting close after 2 years of nada

comment:6 @dd323 years ago

  • Keywords 3.2-early removed
  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from new to closed

2 years, no duplicate reports, a change that AFAIK is harmless & useless (other than making twice as many string operations).

I'm going with invalid for now unless another report comes in, or a bug is pointed to in PHP we need to work around.

If the original reporter can still duplicate it, or someone else runs into it, we can look at it again.

comment:7 @rmccue3 years ago

  • Keywords close removed
Note: See TracTickets for help on using tickets.