check explicitely all possible dir values

This commit is contained in:
Bjoern Schiessle 2013-12-02 12:13:32 +01:00
parent edc4447d6a
commit fac2f2a626
1 changed files with 3 additions and 2 deletions

View File

@ -7,11 +7,12 @@ OCP\JSON::callCheck();
if (isset($_POST['allfiles']) and $_POST['allfiles'] === 'true'){
$deleteAll = true;
$folder = isset($_POST['dir']) ? $_POST['dir'] : '/';
if ($folder === '/') {
if ($folder === '/' || $folder === '') {
OCA\Files_Trashbin\Trashbin::deleteAll();
$list = array();
} else {
if ( strlen(dirname($folder)) > 1 ) {
$dirname = dirname($folder);
if ( $dirname !== '/' && $dirname !== '.' ) {
$dirlisting = '1';
} else {
$dirlisting = '0';