mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-05 07:58:35 +01:00
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;
|
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
|
||||||
}
|
}
|
||||||
$temp = tmpfile();
|
$temp = tmpfile();
|
||||||
|
if ( ! $temp )
|
||||||
|
return false;
|
||||||
if( ! @ftp_fget($this->link,$temp,$file,$type,$resumepos) )
|
if( ! @ftp_fget($this->link,$temp,$file,$type,$resumepos) )
|
||||||
return false;
|
return false;
|
||||||
fseek($temp, 0); //Skip back to the start of the file being written to
|
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;
|
$type = isset($this->filetypes[ $extension ]) ? $this->filetypes[ $extension ] : FTP_ASCII;
|
||||||
}
|
}
|
||||||
$temp = tmpfile();
|
$temp = tmpfile();
|
||||||
|
if ( ! $temp )
|
||||||
|
return false;
|
||||||
fwrite($temp,$contents);
|
fwrite($temp,$contents);
|
||||||
fseek($temp, 0); //Skip back to the start of the file being written to
|
fseek($temp, 0); //Skip back to the start of the file being written to
|
||||||
$ret = @ftp_fput($this->link,$file,$temp,$type);
|
$ret = @ftp_fput($this->link,$file,$temp,$type);
|
||||||
|
@ -159,6 +159,8 @@ class WP_Filesystem_ftpsockets{
|
|||||||
}
|
}
|
||||||
$this->ftp->SetType($type);
|
$this->ftp->SetType($type);
|
||||||
$temp = tmpfile();
|
$temp = tmpfile();
|
||||||
|
if ( ! $temp )
|
||||||
|
return false;
|
||||||
if ( ! $this->ftp->fget($temp, $file) ) {
|
if ( ! $this->ftp->fget($temp, $file) ) {
|
||||||
fclose($temp);
|
fclose($temp);
|
||||||
return ''; //Blank document, File does exist, Its just blank.
|
return ''; //Blank document, File does exist, Its just blank.
|
||||||
@ -183,6 +185,8 @@ class WP_Filesystem_ftpsockets{
|
|||||||
$this->ftp->SetType($type);
|
$this->ftp->SetType($type);
|
||||||
|
|
||||||
$temp = tmpfile();
|
$temp = tmpfile();
|
||||||
|
if ( ! $temp )
|
||||||
|
return false;
|
||||||
fwrite($temp,$contents);
|
fwrite($temp,$contents);
|
||||||
fseek($temp, 0); //Skip back to the start of the file being written to
|
fseek($temp, 0); //Skip back to the start of the file being written to
|
||||||
$ret = $this->ftp->fput($file, $temp);
|
$ret = $this->ftp->fput($file, $temp);
|
||||||
|
Loading…
Reference in New Issue
Block a user