Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when copying to a folder with spaces in its name #153

Closed
SalimSalici opened this issue Apr 5, 2017 · 1 comment
Closed

Error when copying to a folder with spaces in its name #153

SalimSalici opened this issue Apr 5, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@SalimSalici
Copy link
Contributor

Hi, I noticed that when I try to copy a file to a folder that has a spaces in its name, an error occurs.

After some debugging I discovered that these three lines of code (in the function actionCopy defined in connectors/php/LocalFileManager.php)

$target_input = $this->get['target'];
$target_path = $target_input . '/';
$target_path = $this->expandPath($target_path, true);

replace every space with an underscore. This is done by $this->expandPath($target_path, true);.

This line of code then $target_fullpath = $this->getFullPath($target_path, true); fails to find the requested path, because the folder name has been changed before by adding underscores.

By setting the second parameter of expandePath to false, the spaces don't get replaced and the copy works fine.

I'd like to know if this is the correct way to procede, or if I may run into some other problems (security issues for example).

Thank you.

@SalimSalici SalimSalici changed the title Issue when copying to a folder with spaces in its name Error when copying to a folder with spaces in its name Apr 5, 2017
@psolom psolom self-assigned this Apr 6, 2017
@psolom psolom added the bug label Apr 6, 2017
@psolom psolom added this to the 2.3.2 milestone Apr 6, 2017
@psolom
Copy link
Owner

psolom commented Apr 6, 2017

It's a bug. The second parameter should be true only for new folders, not existing ones.
I have performed and committed a fix. Thanks for reporting.

@psolom psolom closed this as completed Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants