Closed GraphicHealer closed 1 year ago
Hi,
This bug is located in a plugin, so it is up to the plugin maintainer to address it. Please open an issue on plugin repository.
Regards
@cedric-anne This is an issue with the Notification templates. That is a GLPI feature, the bug is located in the Notification Templates, not the webhook plugin itself. How is this the plugin's fault?
Hi,
All data stored in GLPI database is stored with special chars encoded. This is a real pain, but changing this is not so simple (we are working on it, see #12451).
When email notifications are sent by GLPI, data sanitization is reverted before being used, see https://github.com/glpi-project/glpi/blob/78c83ac4a6e070c4f1b7c0294adadaafe84e8ac2/src/NotificationTemplate.php#L287-L288
It is us to the plugin to do such operation in PluginWebhookNotificationEventWebhook
.
Ahhhh ok, so there is a way to setup webhook plugin to revert the sanitization. I'll check with them then. Thanks!
Code of Conduct
Is there an existing issue for this?
Version
10.0.6
Bug description
When a webhook is created in GLPI and a notification template is used, something in the notification template translates text characters to URL encoding. For example, the character "<" becomes "%3C". Some webhook require these characters to be passed directly through, and this automatic encoding breaks this functionality.
An example: Microsoft Teams has the ability using Webhooks to mention a user in a feed. The json looks like this (Example from here):
As you can see, the
<at>
and</at>
tags are required for the user mention to be passed through to Teams. These tags are being processed into unrecognized strings, and teams rejects the message because of this.I am currently using a webhook forwarder service to translate those strings back into the correct format, but it would be better if GLPI could do this automatically.
Relevant log output
No response
Page URL
front/notificationtemplatetranslation.form.php
Steps To reproduce
Your GLPI setup information
Information about system installation & configuration
Server
GLPI constants
Libraries
SQL replicas
Notifications
Plugins list
Anything else?
No response