fix error in autocomplete when try to list non-existing or unreadable folders
This commit is contained in:
parent
9e420e4639
commit
190908bc1e
|
@ -40,8 +40,9 @@ $query=strtolower($query);
|
|||
|
||||
$files=array();
|
||||
|
||||
if(OC_FILESYSTEM::is_dir($base)){
|
||||
if(OC_FILESYSTEM::file_exists($base) and OC_FILESYSTEM::is_dir($base)){
|
||||
$dh = OC_FILESYSTEM::opendir($base);
|
||||
if($dh){
|
||||
if(substr($base,-1,1)!='/'){
|
||||
$base=$base.'/';
|
||||
}
|
||||
|
@ -56,6 +57,7 @@ if(OC_FILESYSTEM::is_dir($base)){
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo json_encode($files);
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue