- $is_valid = true;
- if (!is_null($jobids)) {
- $jobidsList = explode(',', $jobids);
- if(is_array($jobidsList)) {
- for($i = 0; $i < count($jobidsList); $i++) {
- $job = $this->getModule('job')->getJobById($jobidsList[$i]);
- if(is_null($job)) {
- $is_valid = false;
- break;
- }
- }
- } else {
- $is_valid = false;
- }
- } else {
- $is_valid = false;
+ if (!is_null($jobids) && !$misc->isValidIdsList($jobids)) {
+ $this->output = BVFSError::MSG_ERROR_INVALID_JOBID_LIST;
+ $this->error = BVFSError::ERROR_INVALID_JOBID_LIST;
+ return;
+ }
+ if (!is_null($fileids) && !$misc->isValidIdsList($fileids)) {
+ $this->output = BVFSError::MSG_ERROR_INVALID_FILEID_LIST;
+ $this->error = BVFSError::ERROR_INVALID_FILEID_LIST;
+ return;
+ }
+ if (!is_null($dirids) && !$misc->isValidIdsList($dirids)) {
+ $this->output = BVFSError::MSG_ERROR_INVALID_DIRID_LIST;
+ $this->error = BVFSError::ERROR_INVALID_DIRID_LIST;
+ return;
+ }
+ if (!is_null($findexes) && !$misc->isValidIdsList($findexes)) {
+ $this->output = BVFSError::MSG_ERROR_INVALID_FILEINDEX_LIST;
+ $this->error = BVFSError::ERROR_INVALID_FILEINDEX_LIST;
+ return;