Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-35412 core: Moving get_string out of if statement

  • Loading branch information...
commit 335636f55db85faa54d6854d62d614402a5b5152 1 parent 9826891
@FMCorz FMCorz authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/moodlelib.php
View
6 lib/moodlelib.php
@@ -2116,7 +2116,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');
@@ -2124,7 +2125,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');
Please sign in to comment.
Something went wrong with that request. Please try again.