MDL-15252 Fixed regression: timezone name string may not be defined
authorDavid Mudrak <david.mudrak@gmail.com>
Fri, 23 Apr 2010 00:11:54 +0000 (00:11 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Fri, 23 Apr 2010 00:11:54 +0000 (00:11 +0000)
lib/moodlelib.php

index 999def3..fb9dfb8 100644 (file)
@@ -6612,7 +6612,11 @@ function get_list_of_timezones() {
     if ($rawtimezones = $DB->get_records_sql("SELECT MAX(id), name FROM {timezone} GROUP BY name")) {
         foreach($rawtimezones as $timezone) {
             if (!empty($timezone->name)) {
-                $timezones[$timezone->name] = get_string(strtolower($timezone->name), 'timezones');
+                if (get_string_manager()->string_exists(strtolower($timezone->name), 'timezones')) {
+                    $timezones[$timezone->name] = get_string(strtolower($timezone->name), 'timezones');
+                } else {
+                    $timezones[$timezone->name] = $timezone->name;
+                }
                 if (substr($timezones[$timezone->name], 0, 1) == '[') {  // No translation found
                     $timezones[$timezone->name] = $timezone->name;
                 }