Skip to content

Commit ab46180

Browse files
committed
MC-35649: Admin Login Unusable on PHP 7.4 Due to PHP Notices
1 parent ab5120a commit ab46180

File tree

1 file changed

+14
-3
lines changed
  • lib/internal/Magento/Framework/View/Element/Html

1 file changed

+14
-3
lines changed

lib/internal/Magento/Framework/View/Element/Html/Calendar.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,20 @@ protected function _toHtml()
107107
]
108108
);
109109

110-
// get "today" and "week" words
111-
$this->assign('today', $this->encoder->encode($localeData['fields']['day']['relative']['0']));
112-
$this->assign('week', $this->encoder->encode($localeData['fields']['week']['dn']));
110+
/**
111+
* Get "today" and "week" words
112+
*
113+
* Fields value in the current position have been added to ICU Data tables,
114+
* starting with ICU library version 51.1.
115+
* Due to fact that we do not use these variables in templates, we do not initialize them for older versions
116+
*
117+
* @see https://github.com/unicode-org/icu/blob/release-50-2/icu4c/source/data/locales/en.txt
118+
* @see https://github.com/unicode-org/icu/blob/release-51-2/icu4c/source/data/locales/en.txt
119+
*/
120+
if ($localeData->get('fields')) {
121+
$this->assign('today', $this->encoder->encode($localeData['fields']['day']['relative']['0']));
122+
$this->assign('week', $this->encoder->encode($localeData['fields']['week']['dn']));
123+
}
113124

114125
// get "am" & "pm" words
115126
$this->assign('am', $this->encoder->encode($localeData['calendar']['gregorian']['AmPmMarkers']['0']));

0 commit comments

Comments
 (0)