Permalink
Browse files

MDL-35412 core: Moving get_string out of if statement

  • Loading branch information...
FMCorz committed Oct 16, 2012
1 parent 9826891 commit 335636f55db85faa54d6854d62d614402a5b5152
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/moodlelib.php
View
@@ -2116,15 +2116,17 @@ 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');
} else {
$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');

0 comments on commit 335636f

Please sign in to comment.