mirror of
https://github.com/HaschekSolutions/pictshare.git
synced 2025-11-12 03:06:22 +00:00
fixed bug that wouldnt allow creation of folders name 0
This commit is contained in:
@@ -87,12 +87,15 @@ class FTPStorage implements StorageController
|
|||||||
{
|
{
|
||||||
if(!$this->connect()) return false;
|
if(!$this->connect()) return false;
|
||||||
@ftp_chdir($this->connection, FTP_BASEDIR);
|
@ftp_chdir($this->connection, FTP_BASEDIR);
|
||||||
$parts = array_filter(explode('/',$ftpath));
|
$parts = array_filter(explode('/',$ftpath), function($value) {
|
||||||
|
return ($value !== null && $value !== false && $value !== '');
|
||||||
|
});
|
||||||
foreach($parts as $part){
|
foreach($parts as $part){
|
||||||
if(!@ftp_chdir($this->connection, $part)){
|
$part = strval($part);
|
||||||
ftp_mkdir($this->connection, $part);
|
if(!@ftp_chdir($this->connection, $part)){
|
||||||
ftp_chdir($this->connection, $part);
|
ftp_mkdir($this->connection, $part);
|
||||||
}
|
ftp_chdir($this->connection, $part);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user