From 345a010ea49f5e9f3271cda5aa11ffdd29559900 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Luca=20B=C3=B6sch?= Date: Tue, 6 Mar 2018 00:15:38 +0100 Subject: [PATCH] MDL-36157 block_rss_client: Don't double escape titles. --- blocks/rss_client/block_rss_client.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index c326d4299c8..bc6d7c5eee6 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -205,9 +205,11 @@ } if(empty($feedrecord->preferredtitle)){ + // Simplepie does escape HTML entities. $feedtitle = $this->format_title($simplepiefeed->get_title()); }else{ - $feedtitle = $this->format_title($feedrecord->preferredtitle); + // Moodle custom title does not does escape HTML entities. + $feedtitle = $this->format_title(s($feedrecord->preferredtitle)); } if (empty($this->config->title)){ @@ -265,10 +267,12 @@ /** * Strips a large title to size and adds ... if title too long + * This function does not escape HTML entities, so they have to be escaped + * before being passed here. * * @param string title to shorten * @param int max character length of title - * @return string title s() quoted and shortened if necessary + * @return string title shortened if necessary */ function format_title($title,$max=64) { -- 2.11.4.GIT