From 78f783252cbd6189c4be5d118fd2046cc1de9197 Mon Sep 17 00:00:00 2001 From: misol Date: Thu, 28 Jun 2012 06:54:27 +0000 Subject: [PATCH] Issue 1974 Check if it is a file. (When the module update 'XE Core', '/' is not a file but the code try to open the directory as a file. So, before it open the directory, check if it is a file. git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10802 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/autoinstall/autoinstall.lib.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/autoinstall/autoinstall.lib.php b/modules/autoinstall/autoinstall.lib.php index d2210ba17..950ddb82a 100644 --- a/modules/autoinstall/autoinstall.lib.php +++ b/modules/autoinstall/autoinstall.lib.php @@ -586,10 +586,14 @@ } } } - 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"); - } + if(is_file(FileHandler::getRealPath($this->download_path."/".$org_file))) + { + echo FileHandler::getRealPath($this->download_path."/".$org_file); + 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"); + } + } } $this->_close();