Ticket #10522: class-wp-filesystem-ftpext.php.2.patch
File class-wp-filesystem-ftpext.php.2.patch, 1.4 KB (added by , 16 years ago) |
---|
-
class-wp-filesystem-ftpext.php
16 16 */ 17 17 class WP_Filesystem_FTPext extends WP_Filesystem_Base { 18 18 var $link; 19 var $timeout = 5;19 var $timeout = 30; 20 20 var $errors = null; 21 21 var $options = array(); 22 22 … … 43 43 else 44 44 $this->options['hostname'] = $opt['hostname']; 45 45 46 if ( isset($opt['connect_timeout']) && ! empty($opt['connect_timeout']) && 0 < intval($opt['connect_timeout'])) 47 $this->timeout = intval($opt['connect_timeout']); 48 46 49 if ( isset($opt['base']) && ! empty($opt['base']) ) 47 50 $this->wp_base = $opt['base']; 48 51 … … 73 76 return false; 74 77 } 75 78 79 $start_time = array_sum(explode(chr(32), microtime())); // this should be PHP 4 save 76 80 if ( ! @ftp_login($this->link,$this->options['username'], $this->options['password']) ) { 77 $this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username'])); 81 $finish_time = array_sum(explode(chr(32), microtime())); 82 if ( ($finish_time - $start_time) > $this->timeout ) { 83 $this->errors->add('auth', __('FTP login process timed out')); 84 } else { 85 $this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username'])); 86 } 78 87 return false; 79 88 } 80 89