Browse files

LIMIT timezones returned to the latest one

  • Loading branch information...
1 parent 19626cf commit 8edffd15f6a3798a488f3a17439605d13ee26b68 moodler committed Apr 10, 2005
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/moodlelib.php
View
6 lib/moodlelib.php
@@ -887,15 +887,15 @@ function get_timezone_record($timezonename) {
global $CFG, $db;
static $cache = NULL;
- if($cache === NULL) {
+ if ($cache === NULL) {
$cache = array();
}
- if(isset($cache[$timezonename])) {
+ if (isset($cache[$timezonename])) {
return $cache[$timezonename];
}
- return get_record_sql('SELECT * FROM '.$CFG->prefix.'timezone WHERE name = '.$db->qstr($timezonename).' ORDER BY year DESC');
+ return get_record_sql('SELECT * FROM '.$CFG->prefix.'timezone WHERE name = '.$db->qstr($timezonename).' ORDER BY year DESC LIMIT 1');
}
function calculate_user_dst_table($from_year = NULL, $to_year = NULL) {

0 comments on commit 8edffd1

Please sign in to comment.