Skip to content

Commit

Permalink
Merge pull request #44 from NETWAYS/fix/substr-deprecation
Browse files Browse the repository at this point in the history
Add type check to substr_count to avoid deprecation warning
  • Loading branch information
martialblog authored Jan 20, 2025
2 parents a923832 + 2281ab5 commit b99be24
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,7 @@ public function getPreviewHtml(Model $object, $report = false)
}

if ($this->repeatable === "yes") {
$panelEnd = ($this->panelId - 1) +
intval(substr_count($object->state->performance_data, '=') / $this->numberMetrics);
$panelEnd = ($this->panelId - 1) + intval(substr_count(strval($object->state->performance_data), '=') / $this->numberMetrics);
$this->panelId = implode(
',',
range($this->panelId, $panelEnd)
Expand Down

0 comments on commit b99be24

Please sign in to comment.