[core] fix #1706 configurable to limit max number of selectable items

Added an option `maxTargets` of connector main option.
This commit is contained in:
nao-pon
2016-10-17 23:47:48 +09:00
parent 4b0dea6d5f
commit 99ff869e77
7 changed files with 77 additions and 30 deletions
+6
View File
@@ -87,6 +87,12 @@ class elFinderConnector {
$_REQUEST = $this->input_filter(array_merge_recursive($src, $_REQUEST));
}
}
if (isset($src['targets']) && $this->elFinder->maxTargets && count($src['targets']) > $this->elFinder->maxTargets) {
$error = $this->elFinder->error(elFinder::ERROR_MAX_TARGTES);
$this->output(array('error' => $this->elFinder->error(elFinder::ERROR_MAX_TARGTES)));
}
$cmd = isset($src['cmd']) ? $src['cmd'] : '';
$args = array();