Make WordPress Core


Ignore:
Timestamp:
06/20/2011 02:58:50 PM (15 years ago)
Author:
westi
Message:

Ensure we have a valid timezone identifier before trying to use it.
Validate the new timezone identifier during option update.
Fixes #17840.

File:
1 edited

Legend:

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

    r17748 r18323  
    163163</select>
    164164
    165     <span id="utc-time"><?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n($timezone_format, false, 'gmt')); ?></span>
     165    <span id="utc-time"><?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n($timezone_format, false, 'gmt')); ?></span>
    166166<?php if ( get_option('timezone_string') || !empty($current_offset) ) : ?>
    167167    <span id="local-time"><?php printf(__('Local time is <code>%1$s</code>'), date_i18n($timezone_format)); ?></span>
     
    183183    <br />
    184184    <?php
    185     if ( function_exists('timezone_transitions_get') ) {
     185    $allowed_zones = timezone_identifiers_list();
     186   
     187    if ( in_array( $tzstring, $allowed_zones) ) {
    186188        $found = false;
    187189        $date_time_zone_selected = new DateTimeZone($tzstring);
Note: See TracChangeset for help on using the changeset viewer.