From ed171889bf72edb9d3106d096eaad2824beb1b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Mon, 31 Dec 2018 16:54:19 +0100 Subject: [PATCH] Avoid double escaping of select options Since the correct transformation method is unclear, change them to plain message keys. Bug: T211876 Change-Id: I055c089574e7dcf5d634da402290a2ad024126f9 --- includes/EchoHooks.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/includes/EchoHooks.php b/includes/EchoHooks.php index 5459992ee..c4bfd8d62 100644 --- a/includes/EchoHooks.php +++ b/includes/EchoHooks.php @@ -313,26 +313,22 @@ class EchoHooks { $attributeManager = EchoAttributeManager::newFromGlobalVars(); // Show email frequency options - $never = wfMessage( 'echo-pref-email-frequency-never' )->escaped(); - $immediately = wfMessage( 'echo-pref-email-frequency-immediately' )->escaped(); $freqOptions = [ - $never => EchoEmailFrequency::NEVER, - $immediately => EchoEmailFrequency::IMMEDIATELY, + 'echo-pref-email-frequency-never' => EchoEmailFrequency::NEVER, + 'echo-pref-email-frequency-immediately' => EchoEmailFrequency::IMMEDIATELY, ]; // Only show digest options if email batch is enabled if ( $wgEchoEnableEmailBatch ) { - $daily = wfMessage( 'echo-pref-email-frequency-daily' )->escaped(); - $weekly = wfMessage( 'echo-pref-email-frequency-weekly' )->escaped(); $freqOptions += [ - $daily => EchoEmailFrequency::DAILY_DIGEST, - $weekly => EchoEmailFrequency::WEEKLY_DIGEST, + 'echo-pref-email-frequency-daily' => EchoEmailFrequency::DAILY_DIGEST, + 'echo-pref-email-frequency-weekly' => EchoEmailFrequency::WEEKLY_DIGEST, ]; } $preferences['echo-email-frequency'] = [ 'type' => 'select', 'label-message' => 'echo-pref-send-me', 'section' => 'echo/emailsettings', - 'options' => $freqOptions + 'options-messages' => $freqOptions ]; // Display information about the user's currently set email address @@ -368,9 +364,9 @@ class EchoHooks { 'type' => 'select', 'label-message' => 'echo-pref-email-format', 'section' => 'echo/emailsettings', - 'options' => [ - wfMessage( 'echo-pref-email-format-html' )->escaped() => EchoEmailFormat::HTML, - wfMessage( 'echo-pref-email-format-plain-text' )->escaped() => EchoEmailFormat::PLAIN_TEXT, + 'options-messages' => [ + 'echo-pref-email-format-html' => EchoEmailFormat::HTML, + 'echo-pref-email-format-plain-text' => EchoEmailFormat::PLAIN_TEXT, ] ]; }