From c5f2d11969ffa061021c81c79d535ecae0c8488f Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Tue, 16 Oct 2012 11:50:25 +0800 Subject: [PATCH] MDL-35412 core: Moving get_string out of if statement --- lib/moodlelib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index d6d7253ddc8..07b6c5673aa 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2128,7 +2128,8 @@ function userdate($date, $format = '', $timezone = 99, $fixday = true, $fixhour function date_format_string($date, $format, $tz = 99) { global $CFG; if (abs($tz) > 13) { - if ($CFG->ostype == 'WINDOWS' and ($localewincharset = get_string('localewincharset', 'langconfig'))) { + if ($CFG->ostype == 'WINDOWS') { + $localewincharset = get_string('localewincharset', 'langconfig'); $format = textlib::convert($format, 'utf-8', $localewincharset); $datestring = strftime($format, $date); $datestring = textlib::convert($datestring, $localewincharset, 'utf-8'); @@ -2136,7 +2137,8 @@ function date_format_string($date, $format, $tz = 99) { $datestring = strftime($format, $date); } } else { - if ($CFG->ostype == 'WINDOWS' and ($localewincharset = get_string('localewincharset', 'langconfig'))) { + if ($CFG->ostype == 'WINDOWS') { + $localewincharset = get_string('localewincharset', 'langconfig'); $format = textlib::convert($format, 'utf-8', $localewincharset); $datestring = gmstrftime($format, $date); $datestring = textlib::convert($datestring, $localewincharset, 'utf-8');