Laravel-FTP icon indicating copy to clipboard operation
Laravel-FTP copied to clipboard

Bug with filenames with more than one space

Open eporral1 opened this issue 9 years ago • 0 comments

Hi, I've found a bug when trying to import files with more that one space in the name.

Here is a fix :

public function getDirListingDetailed($directory = '.') { if (is_array($children = @ftp_rawlist($this->connectionId, $directory))) {

        $items = array();

        foreach ($children as $child) {
            $chunks = preg_split("/\s+/", substr($child,0,61));
            $name = substr($child,62);

            list(
                $item['rights'],
                $item['number'],
                $item['user'],
                $item['group'],
                $item['size'],
                $item['month'],
                $item['day'],
                $item['time']
            ) = $chunks;

            $item['type'] = $chunks[0]{0} === 'd' ? static::TYPE_DIR : static::TYPE_FILE;
            array_splice($chunks, 0, 8);

            $items[implode(" ", $chunks).$name] = $item;
        }
        return $items;
    }

    return false;

}

Coould you include this fix?

Thanks!!

eporral1 avatar Jul 31 '15 15:07 eporral1