mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
Be more careful with checking for target path, could be user selected a directory not a file
This commit is contained in:
parent
5a2c3a530d
commit
d0331ca837
@ -449,7 +449,16 @@ app.classes.filemanager = AppJS.extend(
|
||||
if(action)
|
||||
{
|
||||
var paths = this._elems2paths(selected);
|
||||
if(paths[0]) path = this.dirname(paths[0]);
|
||||
if(paths[0]) path = paths[0];
|
||||
// check if target is a file --> use it's directory instead
|
||||
if(selected[0].id || path)
|
||||
{
|
||||
var data = egw.dataGetUIDdata(selected[0].id || 'filemanager::'+path );
|
||||
if (data && data.data.mime != 'httpd/unix-directory')
|
||||
{
|
||||
path = this.dirname(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
this._do_action('createdir', dir, true, path); // true=synchronous request
|
||||
this.change_dir((path == '/' ? '' : path)+'/'+dir);
|
||||
|
Loading…
Reference in New Issue
Block a user