Issue 1974 Check the path and check the file, if it is null, and there is slash on the last character.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10804 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
misol 2012-06-28 08:14:28 +00:00
parent 7c3a22d8e7
commit 2296bb56e1

View file

@ -542,9 +542,16 @@
$output = $this->_connect();
if(!$output->toBool()) return $output;
if(!$this->target_path) $this->target_path = '.';
if(substr($this->download_path, -1) == '/')
{
$this->download_path = substr($this->download_path, 0, -1);
}
$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
foreach($file_list as $k => $file){
if(!$file) continue;
$org_file = $file;
if($this->package->path == ".")
{
@ -586,15 +593,11 @@
}
}
}
if(is_file(FileHandler::getRealPath($this->download_path."/".$org_file)))
if(!ftp_put($this->connection, $target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file), FTP_BINARY))
{
if(!ftp_put($this->connection, $target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file), FTP_BINARY))
{
return new Object(-1, "msg_ftp_upload_failed");
}
return new Object(-1, "msg_ftp_upload_failed");
}
}
$this->_close();
return new Object();
}