Make WordPress Core


Ignore:
Timestamp:
12/23/2009 02:17:55 PM (15 years ago)
Author:
ryan
Message:

Do not use deprecated Etc timezones. Props miqrogroove. fixes #11558 for 2.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.9/wp-admin/options-general.php

    r11761 r12508  
    140140$current_offset = get_option('gmt_offset');
    141141$tzstring = get_option('timezone_string');
     142
     143$check_zone_info = true;
     144
     145// Remove old Etc mappings.  Fallback to gmt_offset.
     146if ( false !== strpos($tzstring,'Etc/GMT') )
     147    $tzstring = '';
     148
    142149if (empty($tzstring)) { // set the Etc zone if no timezone string exists
    143     if ($current_offset < 0) $offnum = - ceil($current_offset);
    144     else $offnum = - floor($current_offset);
    145     $tzstring = 'Etc/GMT' . (($offnum >= 0) ? '+' : '') . $offnum;
     150    $check_zone_info = false;
     151    if ( 0 == $current_offset )
     152        $tzstring = 'UTC+0';
     153    elseif ($current_offset < 0)
     154        $tzstring = 'UTC' . $current_offset;
     155    else
     156        $tzstring = 'UTC+' . $current_offset;
    146157}
     158
    147159?>
    148160<th scope="row"><label for="timezone_string"><?php _e('Timezone') ?></label></th>
     
    161173<br />
    162174<span>
    163 <?php if ($tzstring) : ?>
     175<?php if ($check_zone_info && $tzstring) : ?>
    164176    <?php
    165177    $now = localtime(time(),true);
Note: See TracChangeset for help on using the changeset viewer.