From 92730c8eb924dfe43d6a9e9b6ed7d86a557e8d6d Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Mon, 25 Apr 2016 11:32:39 +0200 Subject: [PATCH] MDL-53635 message_airnotifier: Remove tags from notifications --- .../airnotifier/message_output_airnotifier.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/message/output/airnotifier/message_output_airnotifier.php b/message/output/airnotifier/message_output_airnotifier.php index d5306b54690..c4f3e9af834 100644 --- a/message/output/airnotifier/message_output_airnotifier.php +++ b/message/output/airnotifier/message_output_airnotifier.php @@ -83,8 +83,19 @@ class message_output_airnotifier extends message_output { // Site name. $site = get_site(); - $extra->sitefullname = format_string($site->fullname); - $extra->siteshortname = format_string($site->shortname); + $extra->sitefullname = clean_param(format_string($site->fullname), PARAM_NOTAGS); + $extra->siteshortname = clean_param(format_string($site->shortname), PARAM_NOTAGS); + + // Clean HTML, push notifications must arrive clean. + if (!empty($extra->smallmessage)) { + $extra->smallmessage = clean_param($extra->smallmessage, PARAM_NOTAGS); + } + if (!empty($extra->fullmessage)) { + $extra->fullmessage = clean_param($extra->fullmessage, PARAM_NOTAGS); + } + if (!empty($extra->fullmessagehtml)) { + $extra->fullmessagehtml = clean_param($extra->fullmessagehtml, PARAM_NOTAGS); + } // We are sending to message to all devices. $airnotifiermanager = new message_airnotifier_manager();