diff --git a/wp-admin/includes/class-wp-filesystem-ftpext.php b/wp-admin/includes/class-wp-filesystem-ftpext.php index 792dae8e0e..b48a125162 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpext.php +++ b/wp-admin/includes/class-wp-filesystem-ftpext.php @@ -167,7 +167,7 @@ class WP_Filesystem_FTPext{ } function put_contents($file,$contents,$type=''){ if( empty($type) ){ - $extension = substr(strrchr($filename, "."), 1); + $extension = substr(strrchr($file, "."), 1); $type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII; } $temp = tmpfile(); diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index e7ccfcc386..9b68387491 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -203,7 +203,7 @@ function download_url( $url ) { if( ! $tmpfname ) return false; - $handle = fopen($tmpfname, 'w'); + $handle = @fopen($tmpfname, 'w'); if( ! $handle ) return false;