Ticket #10522: class-wp-filesystem-ftpext_and_file_without_timeout_error_message.php.patch
File class-wp-filesystem-ftpext_and_file_without_timeout_error_message.php.patch, 2.1 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 … … 72 75 $this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port'])); 73 76 return false; 74 77 } 75 78 76 79 if ( ! @ftp_login($this->link,$this->options['username'], $this->options['password']) ) { 77 80 $this->errors->add('auth', sprintf(__('Username/Password incorrect for %s'), $this->options['username'])); 78 81 return false; -
file.php
679 679 $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname'] : $credentials['hostname']); 680 680 $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']); 681 681 $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : ''); 682 $credentials['connect_timeout'] = defined('FTP_CONNECT_TIMEOUT') ? FTP_CONNECT_TIMEOUT : (!empty($_POST['connect_timeout']) ? $_POST['connect_timeout'] : $credentials['connect_timeout']); 682 683 683 684 // Check to see if we are setting the public/private keys for ssh 684 685 $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? $_POST['public_key'] : '');