Skip to content

Commit

Permalink
fix deprecation for empty parameter for strpos method
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Opolka <[email protected]>
  • Loading branch information
Vincent Gerris authored and martialblog committed Nov 14, 2024
1 parent 699c687 commit f00f439
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/controllers/IcingadbimgController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function init()
if ($this->hasParam('timerangeto')) {
$this->timerangeto = urldecode($this->getParam('timerangeto'));
} else {
$this->timerangeto = strpos($this->timerange, '/') ? 'now-' . $this->timerange : "now";
$this->timerangeto = strpos($this->timerange ?? '', '/') ? 'now-' . $this->timerange ?? '' : "now";
}
$this->cacheTime = $this->hasParam('cachetime') ? $this->getParam('cachetime') : 300;

Expand Down
2 changes: 1 addition & 1 deletion library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private function getGraphConf($serviceName, $serviceCommand = null): ?self
$this->timerange = Url::fromRequest()->hasParam('timerange') ?
'now-' . urldecode(Url::fromRequest()->getParam('timerange')) :
'now-' . $this->getGraphConfigOption($serviceName, 'timerange', $this->timerange);
$this->timerangeto = strpos($this->timerange, '/') ? $this->timerange : $this->timerangeto;
$this->timerangeto = strpos($this->timerange ?? '', '/') ? $this->timerange : $this->timerangeto;
}

$this->height = $this->getGraphConfigOption($serviceName, 'height', $this->height);
Expand Down

0 comments on commit f00f439

Please sign in to comment.