propperly check for passed parameter 'node', pass orderby to view

This commit is contained in:
Uwe Steinmann 2019-11-26 11:20:46 +01:00
parent 413bbad196
commit 87d1df5d03

View File

@ -29,7 +29,7 @@ require_once("inc/inc.ClassUI.php");
require_once("inc/inc.Authentication.php");
if(isset($_GET['action']) && $_GET['action'] == 'subtree') {
if (isset($_GET["node"]) || !is_numeric($_GET["node"]) || intval($_GET["node"])<1) {
if (!isset($_GET["node"]) || !is_numeric($_GET["node"]) || intval($_GET["node"])<1) {
$nodeid = $settings->_rootFolderID;
} else {
$nodeid = intval($_GET["node"]);
@ -48,9 +48,9 @@ if(isset($_GET['action']) && $_GET['action'] == 'subtree') {
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'rootfolderid'=>$settings->_rootFolderID));
if($view) {
$view->setParam('orderby', $settings->_sortFoldersDefault);
if(isset($_GET['action']) && $_GET['action'] == 'subtree') {
$view->setParam('node', $node);
$view->setParam('orderby', $settings->_sortFoldersDefault);
} else {
$view->setParam('form', $form);
$view->setParam('mode', $mode);