Allow html-links in service-details view / Create clickable links from script output

It would be great if there was a possibility to create clickable links from the output of a service-check plugin.
In my case, I’d like to have direct clickable links to details of M365 service icidents. At the moment, the HTML gets escaped by the page renderer, so the links do not work:

Could this be done by a dedicated include to that check or does this mean changes in Libre’s base code?

TIA!

Seems like this can only be done by changing code in Libre. For my tests I changed includes/html/pages/devices/services.inc.php like this:

    if (str_contains(htmlentities($service['service_desc']), '!HTML!')) {
        echo '<td class="col-sm-4">' . nl2br(html_entity_decode(trim($service['service_message']))) . '</td>';
    } else {
        echo '<td class="col-sm-4">' . nl2br(htmlentities(trim($service['service_message']))) . '</td>';
    }

If you add the string “!HTML!” in the description of a service, the output will be rendered as HTML and not escaped. However, this is not a really “clean” solution and I will run into trouble when next update comes.

Is there any “overlay” mechanism where I could place such changes without breaking update mechanism and/or losing my changes?

you are welcome to make this change locally, but I don’t think it will be acceptable upstream due to security implications.

As long as the surrounding code doesn’t change you will get updates. It only breaks if there is a conflict with your local changes.

1 Like

@murrant thanks for your reply.
What if it is configurable per plugin and maybe limited to certain html-tags or domains that need to be “whitelisted” by the user?

Unfortunately I don’t think it will be accepted still