Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Fixed wrong path on classes called (#10842)
Browse files Browse the repository at this point in the history
  • Loading branch information
callapa authored Mar 11, 2022
1 parent 9620748 commit 44ab84e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions www/api/class/centreon_configuration_objects.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function getDefaultValues()
}

// Get Object targeted
if (isset($this->arguments['target'])) {
if (isset($this->arguments['target']) && preg_match('/^[a-zA-Z]+$/', $this->arguments['target'])) {
$target = ucfirst($this->arguments['target']);
} else {
throw new RestBadRequestException("Bad parameters target");
Expand All @@ -80,7 +80,6 @@ public function getDefaultValues()
$calledClass = 'Centreon' . $target;
$defaultValuesParameters = $calledClass::getDefaultValuesParameters($field);
}

if (count($defaultValuesParameters) == 0) {
throw new RestBadRequestException("Bad parameters count");
}
Expand Down

0 comments on commit 44ab84e

Please sign in to comment.