From 44ab84e3a3c23218956f0836762a8d788da8acd4 Mon Sep 17 00:00:00 2001 From: Laurent Calvet Date: Fri, 11 Mar 2022 12:11:04 +0100 Subject: [PATCH] Fixed wrong path on classes called (#10842) --- www/api/class/centreon_configuration_objects.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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"); }