From 5db5522d4dcf9753d6233a8c1824e8976184f700 Mon Sep 17 00:00:00 2001 From: fansaien Date: Thu, 3 Jan 2019 14:04:26 -0600 Subject: [PATCH] Fix the filter options being escaped twice (#4032) Credit to @fansaien. Reference: https://github.com/octobercms/october/pull/3793. This commit added the e() function for translation results. Because the filter is using the mustache template, and the manual said: All variables are HTML escaped by default. If you want to return unescaped HTML, use the triple mustache: {{{name}}} (https://mustache.github.io/mustache.5.html) That means the string will be escaped twice. So, I removed the e(). --- modules/backend/widgets/Filter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/backend/widgets/Filter.php b/modules/backend/widgets/Filter.php index 11d669747..98a161f7c 100644 --- a/modules/backend/widgets/Filter.php +++ b/modules/backend/widgets/Filter.php @@ -934,7 +934,7 @@ class Filter extends WidgetBase { $processed = []; foreach ($options as $id => $result) { - $processed[] = ['id' => $id, 'name' => e(trans($result))]; + $processed[] = ['id' => $id, 'name' => trans($result)]; } return $processed; }