Check return of tmpfile(). see #5586
git-svn-id: http://svn.automattic.com/wordpress/trunk@7403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
81466f4604
commit
ca900d471c
|
@ -152,6 +152,8 @@ class WP_Filesystem_FTPext{
|
|||
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
|
||||
}
|
||||
$temp = tmpfile();
|
||||
if ( ! $temp )
|
||||
return false;
|
||||
if( ! @ftp_fget($this->link,$temp,$file,$type,$resumepos) )
|
||||
return false;
|
||||
fseek($temp, 0); //Skip back to the start of the file being written to
|
||||
|
@ -171,6 +173,8 @@ class WP_Filesystem_FTPext{
|
|||
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
|
||||
}
|
||||
$temp = tmpfile();
|
||||
if ( ! $temp )
|
||||
return false;
|
||||
fwrite($temp,$contents);
|
||||
fseek($temp, 0); //Skip back to the start of the file being written to
|
||||
$ret = @ftp_fput($this->link,$file,$temp,$type);
|
||||
|
|
|
@ -159,6 +159,8 @@ class WP_Filesystem_ftpsockets{
|
|||
}
|
||||
$this->ftp->SetType($type);
|
||||
$temp = tmpfile();
|
||||
if ( ! $temp )
|
||||
return false;
|
||||
if ( ! $this->ftp->fget($temp, $file) ) {
|
||||
fclose($temp);
|
||||
return ''; //Blank document, File does exist, Its just blank.
|
||||
|
@ -183,6 +185,8 @@ class WP_Filesystem_ftpsockets{
|
|||
$this->ftp->SetType($type);
|
||||
|
||||
$temp = tmpfile();
|
||||
if ( ! $temp )
|
||||
return false;
|
||||
fwrite($temp,$contents);
|
||||
fseek($temp, 0); //Skip back to the start of the file being written to
|
||||
$ret = $this->ftp->fput($file, $temp);
|
||||
|
|
Loading…
Reference in New Issue