Skip to content

Commit dea037d

Browse files
authored
Merge pull request #67 from NETWAYS/fix/validhtml
Fix invalid return value for getPreviewHTML
2 parents 8120948 + 1bccc6a commit dea037d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ private function getMyPreviewHtml($serviceName, $hostName, HtmlDocument $preview
338338
* @throws ConfigurationError
339339
* @throws \Icinga\Exception\ProgrammingError
340340
*/
341-
public function getPreviewHtml(Model $object, $report = false)
341+
public function getPreviewHtml(Model $object, $report = false): ValidHtml
342342
{
343343
$this->object = $object;
344344
// Use the cachetime based on the check intervals
@@ -378,7 +378,7 @@ public function getPreviewHtml(Model $object, $report = false)
378378
$customvars = $this->getDb()->fetchPairs($varsFlat->assembleSelect());
379379

380380
if ($object->perfdata_enabled == "n" || (( isset($customvars[$this->custvardisable]) && json_decode(strtolower($customvars[$this->custvardisable])) !== false))) {
381-
return '';
381+
return HtmlString::create('');
382382
}
383383

384384
if (array_key_exists($this->custvarconfig, $customvars)

0 commit comments

Comments
 (0)