diff --git a/www/api/class/centreon_configuration_objects.class.php b/www/api/class/centreon_configuration_objects.class.php index 64b050e6d2c..10801fc8efb 100644 --- a/www/api/class/centreon_configuration_objects.class.php +++ b/www/api/class/centreon_configuration_objects.class.php @@ -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"); @@ -80,7 +80,6 @@ public function getDefaultValues() $calledClass = 'Centreon' . $target; $defaultValuesParameters = $calledClass::getDefaultValuesParameters($field); } - if (count($defaultValuesParameters) == 0) { throw new RestBadRequestException("Bad parameters count"); }