Handle ftp_chdir error
This commit is contained in:
parent
1877dda1a4
commit
c8db19331b
2 changed files with 7 additions and 4 deletions
|
|
@ -89,18 +89,20 @@ function dol_ftp_connect($ftp_server, $ftp_port, $ftp_user, $ftp_password, $sect
|
|||
}
|
||||
} else {
|
||||
if (ftp_login($connect_id, $ftp_user, $ftp_password)) {
|
||||
// Turn on passive mode transfers (must be after a successful login
|
||||
// Turn on passive mode transfers (must be after a successful login)
|
||||
if ($ftp_passive) {
|
||||
ftp_pasv($connect_id, true);
|
||||
}
|
||||
|
||||
// Change the dir
|
||||
$newsectioniso = mb_convert_encoding($section, 'ISO-8859-1');
|
||||
ftp_chdir($connect_id, $newsectioniso);
|
||||
if (!ftp_chdir($connect_id, $newsectioniso)) {
|
||||
$ok = 0;
|
||||
$mesg = $langs->transnoentitiesnoconv("FailedToChdirOnFTPServer");
|
||||
}
|
||||
} else {
|
||||
$mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials");
|
||||
$ok = 0;
|
||||
$error++;
|
||||
$mesg = $langs->transnoentitiesnoconv("FailedToConnectToFTPServerWithCredentials");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,6 +327,7 @@ SetupOfFTPClientModuleNotComplete=The setup of the FTP or SFTP client module see
|
|||
FTPFeatureNotSupportedByYourPHP=Your PHP does not support FTP or SFTP functions
|
||||
FailedToConnectToFTPServer=Failed to connect to server (server %s, port %s)
|
||||
FailedToConnectToFTPServerWithCredentials=Failed to login to server with defined login/password
|
||||
FailedToChdirOnFTPServer=Failed to change directory on the FTP server
|
||||
FTPFailedToRemoveFile=Failed to remove file <b>%s</b>.
|
||||
FTPFailedToRemoveDir=Failed to remove directory <b>%s</b>: check permissions and that the directory is empty.
|
||||
FTPPassiveMode=Passive mode
|
||||
|
|
|
|||
Loading…
Reference in a new issue