From: Tim Otten Date: Wed, 3 Aug 2022 05:00:23 +0000 (-0700) Subject: (REF) I18nSubscriber - Rename parameter to be more evocative X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a3b40d635b2ef2232ffdccae6ac4fa8dba96fabc;p=civicrm-core.git (REF) I18nSubscriber - Rename parameter to be more evocative --- diff --git a/Civi/API/Subscriber/I18nSubscriber.php b/Civi/API/Subscriber/I18nSubscriber.php index d3b732972a..dadce282ba 100644 --- a/Civi/API/Subscriber/I18nSubscriber.php +++ b/Civi/API/Subscriber/I18nSubscriber.php @@ -82,20 +82,20 @@ class I18nSubscriber implements EventSubscriberInterface { * Sets the tsLocale and dbLocale for multi-lingual sites. * Some code duplication from CRM/Core/BAO/ConfigSetting.php retrieve() * to avoid regressions from refactoring. - * @param string $lcMessages + * @param string $newLocale * @param int $requestId * @throws \API_Exception */ - public function setLocale($lcMessages, $requestId) { + public function setLocale($newLocale, $requestId) { $domain = new \CRM_Core_DAO_Domain(); $domain->id = \CRM_Core_Config::domainID(); $domain->find(TRUE); // Check if the site is multi-lingual - if ($domain->locales && $lcMessages) { + if ($domain->locales && $newLocale) { // Validate language, otherwise a bad dbLocale could probably lead to sql-injection. - if (!array_key_exists($lcMessages, \Civi::settings()->get('languageLimit'))) { - throw new \API_Exception(ts('Language not enabled: %1', [1 => $lcMessages])); + if (!array_key_exists($newLocale, \Civi::settings()->get('languageLimit'))) { + throw new \API_Exception(ts('Language not enabled: %1', [1 => $newLocale])); } global $dbLocale; @@ -108,10 +108,10 @@ class I18nSubscriber implements EventSubscriberInterface { ]; // Set suffix for table names - use views if more than one language - $dbLocale = "_{$lcMessages}"; + $dbLocale = "_{$newLocale}"; // Also set tsLocale - CRM-4041 - $tsLocale = $lcMessages; + $tsLocale = $newLocale; } }