From c58b2a1abdf9908013a0f2bd9785fd7a052ff0dc Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Mon, 21 Aug 2023 14:39:56 +0200 Subject: [PATCH] Cast args explicitly to `int` --- application/controllers/GraphController.php | 4 ++-- application/controllers/MonitoringGraphController.php | 4 ++-- library/Graphite/Web/Widget/Graphs.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/controllers/GraphController.php b/application/controllers/GraphController.php index c8dc7dbb..2c591712 100644 --- a/application/controllers/GraphController.php +++ b/application/controllers/GraphController.php @@ -152,8 +152,8 @@ protected function supplyImage($object, $checkCommand, $obscuredCheckCommand) $charts[0] ->setFrom($this->graphParams['start']) ->setUntil($this->graphParams['end']) - ->setWidth($this->graphParams['width']) - ->setHeight($this->graphParams['height']) + ->setWidth((int) $this->graphParams['width']) + ->setHeight((int) $this->graphParams['height']) ->setBackgroundColor($this->graphParams['bgcolor']) ->setForegroundColor($this->graphParams['fgcolor']) ->setMajorGridLineColor($this->graphParams['majorGridLineColor']) diff --git a/application/controllers/MonitoringGraphController.php b/application/controllers/MonitoringGraphController.php index c29c430c..7b9f3f31 100644 --- a/application/controllers/MonitoringGraphController.php +++ b/application/controllers/MonitoringGraphController.php @@ -135,8 +135,8 @@ protected function supplyImage($object, $checkCommand, $obscuredCheckCommand) $charts[0] ->setFrom($this->graphParams['start']) ->setUntil($this->graphParams['end']) - ->setWidth($this->graphParams['width']) - ->setHeight($this->graphParams['height']) + ->setWidth((int) $this->graphParams['width']) + ->setHeight((int) $this->graphParams['height']) ->setBackgroundColor($this->graphParams['bgcolor']) ->setForegroundColor($this->graphParams['fgcolor']) ->setMajorGridLineColor($this->graphParams['majorGridLineColor']) diff --git a/library/Graphite/Web/Widget/Graphs.php b/library/Graphite/Web/Widget/Graphs.php index 9ec83853..e49a0eb4 100644 --- a/library/Graphite/Web/Widget/Graphs.php +++ b/library/Graphite/Web/Widget/Graphs.php @@ -313,8 +313,8 @@ protected function getGraphsList() if ($this->renderInline) { $chart->setFrom($this->start) ->setUntil($this->end) - ->setWidth($actwidth) - ->setHeight($actheight) + ->setWidth((int) $actwidth) + ->setHeight((int) $actheight) ->setBackgroundColor('white') ->setForegroundColor('black') ->setMajorGridLineColor('grey')