if ( empty($opt['port']) )
$this->options['port'] = 21;
else
- $this->options['port'] = $opt['port'];
+ $this->options['port'] = (int) $opt['port'];
if ( empty($opt['hostname']) )
$this->errors->add('empty_hostname', __('FTP hostname is required'));
$temp = wp_tempnam( $file );
- if ( ! $temphandle = fopen($temp, 'w+') )
+ if ( ! $temphandle = fopen( $temp, 'w+' ) ) {
+ unlink( $temp );
return false;
+ }
mbstring_binary_safe_encoding();